- visual = DefaultVisual(disp, screen);
+ visual = DefaultVisual(disp, screen);
- ximage = XCreateImage(disp, visual, depth, ZPixmap, 0,
- NULL, view.width, view.height,
- 8, 0);
+ ximage = XCreateImage(disp, visual, depth, ZPixmap, 0,
+ NULL, view.width, view.height,
+ 8, 0);
memset( *(view.data), 0, view.dataSize);
ximage->data = (char *)*(view.data);
ximage->byte_order= MSBFirst;
-
+
done = 0;
while( done==0)
| ((dest_g << dest_g_offset) & dest->green_mask)
| ((dest_b << dest_b_offset) & dest->blue_mask);
- if ((y == 150) && (x == 200))
- printf ("[200x150] RGB(%u,%u,%u) -> RGB(%u,%u,%u) -> 0x%04x\n",
- src_r, src_g, src_b,
- dest_r, dest_g, dest_b,
- dest_pixel_value);
for (bytenum = 0; bytenum < (dest->depth / 8); bytenum++)
{
- int offset = (pixel * dest->bits_per_pixel / 8) + bytenum;
dest->data[(pixel * dest->bits_per_pixel / 8) + bytenum] =
(dest_pixel_value >> (dest->bits_per_pixel - (8 * (bytenum + 1)))) & 0xFF;
- if ((y == 150) && (x == 200))
- printf ("Setting byte #%i to 0x%02x\n",
- offset, dest->data[offset]);
}
}
}
myfree((void**)view.data);
view.width = xa.width;
view.height = xa.height;
- view.bytesPerLine = view.width * view.bitsPerPixel / 8;
- view.dataSize = view.bytesPerLine * view.height;
- view.format = 1;
- view.data = (unsigned char**)mymalloc( view.dataSize );
- if(view.data == NULL)
- {
- PrintError("Not enough memory");
- exit(0);
- }
-
- ximage = XCreateImage(disp, visual, depth, ZPixmap, 0,
- NULL, view.width, view.height,
- 8, 0);
- ximage->data = (char *)*(view.data);
- ximage->byte_order= MSBFirst;
+ view.bytesPerLine = view.width * view.bitsPerPixel / 8;
+ view.dataSize = view.bytesPerLine * view.height;
+ view.format = 1;
+ view.data = (unsigned char**)mymalloc( view.dataSize );
+ if(view.data == NULL)
+ {
+ PrintError("Not enough memory");
+ exit(0);
+ }
+
+ ximage = XCreateImage(disp, visual, depth, ZPixmap, 0,
+ NULL, view.width, view.height,
+ 8, 0);
+ ximage->data = (char *)*(view.data);
+ ximage->byte_order= MSBFirst;
}
if( view.format )
{