https://bugzilla.novell.com/show_bug.cgi?id=274842 ------- Comment #4 from sndirsch@novell.com 2007-05-16 06:48 MST ------- Just to get an idea of the complete context. /* * CreateImage * * Allocates the memory necessary for an XImage data structure. * Initializes the structure with "default" values and returns XImage. * */ XImage *XCreateImage ( register Display *dpy, register Visual *visual, unsigned int depth, int format, int offset, /*How many pixels from the start of the data does the picture to be transmitted start?*/ char *data, unsigned int width, unsigned int height, int xpad, int image_bytes_per_line) /*How many bytes between a pixel on one line and the pixel with the same X coordinate on the next line? 0 means XCreateImage can calculate it.*/ { register XImage *image; int bits_per_pixel = 1; int min_bytes_per_line; if (depth == 0 || depth > 32 || (format != XYBitmap && format != XYPixmap && format != ZPixmap) || (format == XYBitmap && depth != 1) || (xpad != 8 && xpad != 16 && xpad != 32) || offset < 0) return (XImage *) NULL; if ((image = (XImage *) Xcalloc(1, (unsigned) sizeof(XImage))) == NULL) return (XImage *) NULL; image->width = width; image->height = height; image->format = format; image->byte_order = dpy->byte_order; image->bitmap_unit = dpy->bitmap_unit; image->bitmap_bit_order = dpy->bitmap_bit_order; if (visual != NULL) { image->red_mask = visual->red_mask; image->green_mask = visual->green_mask; image->blue_mask = visual->blue_mask; } else { image->red_mask = image->green_mask = image->blue_mask = 0; } if (format == ZPixmap) { bits_per_pixel = _XGetBitsPerPixel(dpy, (int) depth); } image->xoffset = offset; image->bitmap_pad = xpad; image->depth = depth; image->data = data; /* * compute per line accelerator. */ { if (format == ZPixmap) min_bytes_per_line = ROUNDUP((bits_per_pixel * width), image->bitmap_pad); else min_bytes_per_line = ROUNDUP((width + offset), image->bitmap_pad); } if (image_bytes_per_line == 0) { image->bytes_per_line = min_bytes_per_line; } else if (image_bytes_per_line < min_bytes_per_line) { return 0; } else { image->bytes_per_line = image_bytes_per_line; } image->bits_per_pixel = bits_per_pixel; image->obdata = NULL; _XInitImageFuncPtrs (image); return image; } -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.