Changeset 199 for libcaca/trunk/src/blit.c
- Timestamp:
- Nov 19, 2003, 6:32:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/blit.c
r198 r199 102 102 } 103 103 104 //pitch = (3 * w + 3) / 4 * 4;105 pitch = 4 * w;104 pitch = (3 * w + 3) / 4 * 4; 105 //pitch = 4 * w; 106 106 107 107 for(y = y1 > 0 ? y1 : 0; y <= y2 && y <= (int)caca_get_height(); y++) … … 115 115 int fromx = w * (x - x1) / (x2 - x1 + 1); 116 116 int fromy = h * (y - y1) / (y2 - y1 + 1); 117 //int r = ((unsigned char *)pixels)[3 * fromx + pitch * fromy];118 //int g = ((unsigned char *)pixels)[3 * fromx + 1 + pitch * fromy];119 //int b = ((unsigned char *)pixels)[3 * fromx + 2 + pitch * fromy];120 int b = ((unsigned char *)pixels)[4 * fromx + pitch * fromy];121 int g = ((unsigned char *)pixels)[4 * fromx + 1 + pitch * fromy];122 int r = ((unsigned char *)pixels)[4 * fromx + 2 + pitch * fromy];117 int r = ((unsigned char *)pixels)[3 * fromx + pitch * fromy]; 118 int g = ((unsigned char *)pixels)[3 * fromx + 1 + pitch * fromy]; 119 int b = ((unsigned char *)pixels)[3 * fromx + 2 + pitch * fromy]; 120 //int b = ((unsigned char *)pixels)[4 * fromx + pitch * fromy]; 121 //int g = ((unsigned char *)pixels)[4 * fromx + 1 + pitch * fromy]; 122 //int r = ((unsigned char *)pixels)[4 * fromx + 2 + pitch * fromy]; 123 123 int hue, sat, val; 124 124 … … 143 143 hue = 1280 + 256 * (r - g) / delta; 144 144 145 hue = (hue + 128 + 8* _get_dither()) / 256;145 hue = (hue + 128 + 16 * _get_dither()) / 256; 146 146 147 147 if(val > (_get_dither() + 40) * 4)
Note: See TracChangeset
for help on using the changeset viewer.