Fix dithering stupidity in cammy_image_dither()

This commit is contained in:
XANTRONIX Development 2016-05-15 02:59:26 -05:00
parent 180b36203b
commit d18c319c89

View file

@ -140,6 +140,10 @@ void cammy_photo_dither(uint8_t *dest,
int width,
int height,
int stride) {
static uint8_t values[4] = {
0, 86, 171, 255
};
size_t x, y;
for (y=0; y<height; y++) {
@ -164,9 +168,11 @@ void cammy_photo_dither(uint8_t *dest,
value = from ^ 0x03;
}
dest[stride*CAMMY_PHOTO_WIDTH*y+stride*x] = value;
dest[stride*CAMMY_PHOTO_WIDTH*y+stride*x+1] = value;
dest[stride*CAMMY_PHOTO_WIDTH*y+stride*x+2] = value;
value ^= 3;
dest[stride*width*y+stride*x] = values[value];
dest[stride*width*y+stride*x+1] = values[value];
dest[stride*width*y+stride*x+2] = values[value];
}
}
}