From 9c7015f144c33192e852d406d7a7940c11e585e0 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 15 Aug 2007 10:41:45 +0200 Subject: [PATCH] viewer.c: Removed debugging output and fixed indentation. --- src/viewer.c | 49 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/src/viewer.c b/src/viewer.c index 123d42b..d9c5c5d 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -184,16 +184,16 @@ int main( int argc, char** argv ) - 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) @@ -527,19 +527,10 @@ static int copy_rgb_to_zpixmap (XImage *dest, const Image *src) | ((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]); } } } @@ -558,21 +549,21 @@ void DrawWindow() 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 ) { -- 2.11.0