- // since pixel32 is the largest possible pixel size, we can share the array
- int r, g, b;
- int x,y;
- pixel16 *p = (pixel16*) data;
- switch (im->bits_per_pixel) {
- case 32:
- if ((render_red_offset != default_red_shift) ||
- (render_blue_offset != default_blue_shift) ||
- (render_green_offset != default_green_shift)) {
- for (y = 0; y < im->height; y++) {
- for (x = 0; x < im->width; x++) {
- r = (data[x] >> default_red_shift) & 0xFF;
- g = (data[x] >> default_green_shift) & 0xFF;
- b = (data[x] >> default_blue_shift) & 0xFF;
- data[x] = (r << render_red_offset) + (g << render_green_offset) +
- (b << render_blue_offset);
+ /* since pixel32 is the largest possible pixel size, we can share the
+ array*/
+ int r, g, b;
+ int x,y;
+ pixel16 *p = (pixel16*) data;
+ switch (im->bits_per_pixel) {
+ case 32:
+ if ((render_red_offset != default_red_shift) ||
+ (render_blue_offset != default_blue_shift) ||
+ (render_green_offset != default_green_shift)) {
+ for (y = 0; y < im->height; y++) {
+ for (x = 0; x < im->width; x++) {
+ r = (data[x] >> default_red_shift) & 0xFF;
+ g = (data[x] >> default_green_shift) & 0xFF;
+ b = (data[x] >> default_blue_shift) & 0xFF;
+ data[x] = (r << render_red_offset) + (g << render_green_offset) +
+ (b << render_blue_offset);
+ }
+ data += im->width;
+ }