Revision 113
added macros to easen work
lab5.c | ||
---|---|---|
193 | 193 |
if(get_bytes_pixel() == 1){ |
194 | 194 |
color = (first + (row * no_rectangles + col) * step) % (1 << get_bits_pixel()); |
195 | 195 |
}else{ |
196 |
R = (0xFF&(first>>16) + col*step) % (1 << get_RedMaskSize());
|
|
197 |
G = (0xFF&(first>> 8) + row*step) % (1 << get_GreenMaskSize());
|
|
198 |
B = (0xFF&(first ) + (col+row)*step) % (1 << get_BlueMaskSize());
|
|
199 |
color = (R<<16) | (G<<8) | (B);
|
|
196 |
R = (GET_RED(first) + col*step) % (1 << get_RedMaskSize());
|
|
197 |
G = (GET_GRE(first) + row*step) % (1 << get_GreenMaskSize());
|
|
198 |
B = (GET_BLU(first) + (col+row)*step) % (1 << get_BlueMaskSize());
|
|
199 |
color = SET_COLOR(R,G,B);
|
|
200 | 200 |
} |
201 | 201 |
if (vg_draw_rectangle(col*W,row*H,W,H,color)) { |
202 | 202 |
if (vg_exit()) { |
Also available in: Unified diff