| 262 | |
| 263 | |
| 264 | void initBuf(int x, int y, int width, int height, PF *pf, unsigned char *buf) |
| 265 | { |
| 266 | int i, j, maxRGB = (1 << pf->bpc); |
| 267 | for(j = 0; j < height; j++) |
| 268 | { |
| 269 | for(i = 0; i < width; i++) |
| 270 | { |
| 271 | if(pf->id == PF_COMP) |
| 272 | buf[j * width + i] = ((j + y) * (i + x)) % maxRGB; |
| 273 | else |
| 274 | { |
| 275 | pf->setRGB(&buf[(j * width + i) * pf->size], |
| 276 | ((j + y) * (i + x)) % maxRGB, |
| 277 | ((j + y) * (i + x) * 2) % maxRGB, ((j + y) * (i + x) * 3) % maxRGB); |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | |
| 284 | int cmpBuf(int x, int y, int width, int height, PF *pf, unsigned char *buf, |