| 58 | |
| 59 | |
| 60 | static int cmpBuf(unsigned char *buf, int width, int pitch, int height, PF *pf, |
| 61 | int orientation) |
| 62 | { |
| 63 | int i, j, retval = 1; |
| 64 | |
| 65 | for(j = 0; j < height; j++) |
| 66 | { |
| 67 | int row = orientation == BMPORN_TOPDOWN ? j : height - j - 1; |
| 68 | for(i = 0; i < width; i++) |
| 69 | { |
| 70 | int r, g, b; |
| 71 | pf->getRGB(&buf[row * pitch + i * pf->size], &r, &g, &b); |
| 72 | if(pf->bpc == 10) |
| 73 | { |
| 74 | r >>= 2; g >>= 2; b >>= 2; |
| 75 | } |
| 76 | if(r != (i * 256 / width) % 256 || g != (j * 256 / height) % 256 |
| 77 | || b != (j * 256 / height + i * 256 / width) % 256) |
| 78 | retval = 0; |
| 79 | } |
| 80 | } |
| 81 | return retval; |
| 82 | } |
| 83 | |
| 84 | |
| 85 | static int doTest(const char *ext, int width, int align, int height, PF *pf, |