NAME
XGetPixel — obtain a single pixel value from an image.
SYNOPSIS
unsigned long XGetPixel(ximage, x, y)
XImage ∗ximage;
int x;
int y;
ARGUMENTS
ximageSpecifies a pointer to the image.
x
ySpecify the x and y coordinates of the pixel whose value is to be returned.
RETURNS
The pixel value.
DESCRIPTION
XGetPixel() returns the specified pixel from the named image. The x and y coordinates are relative to the origin (upper left [0,0]) of the image). The pixel value is returned in the normalized format (that is, the least-significant byte of the long is the least-significant byte of the pixel). The x and y coordinates must be contained in the image.
For more information, see Volume One, Chapter 6, Drawing Graphics and Text.
STRUCTURES
typedef struct _XImage {
int width, height; /∗ size of image ∗/
int xoffset; /∗ number of pixels offset in X direction ∗/
int format; /∗ XYBitmap, XYPixmap, ZPixmap ∗/
char ∗data; /∗ pointer to image data ∗/
int byte_order; /∗ data byte order, LSBFirst, MSBFirst ∗/
int bitmap_unit; /∗ quant. of scan line 8, 16, 32 ∗/
int bitmap_bit_order; /∗ LSBFirst, MSBFirst ∗/
int bitmap_pad; /∗ 8, 16, 32 either XY or ZPixmap ∗/
int depth; /∗ depth of image ∗/
int bytes_per_line; /∗ accelerator to next line ∗/
int bits_per_pixel; /∗ bits per pixel (ZPixmap) ∗/
unsigned long red_mask; /∗ bits in z arrangment ∗/
unsigned long green_mask;
unsigned long blue_mask;
char ∗obdata; /∗ hook for the object routines to hang on ∗/
struct funcs { /∗ image manipulation routines ∗/
struct _XImage ∗(∗create_image)();
int (∗destroy_image)();
unsigned long (∗get_pixel)();
int (∗put_pixel)();
struct _XImage ∗(∗sub_image)();
int (∗add_pixel)();
} f; } XImage;
SEE ALSO
XImageByteOrder(), XAddPixel(), XCreateImage(), XDestroyImage(), XGetImage(), XGetSubImage(), XPutImage(), XPutPixel(), XSubImage().
Xlib Reference Manual