Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XAddPixel(3x) — HP-UX ANSI C A.09.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XAddPixel − add a constant value to every pixel value in an image. 

Synopsis

XAddPixel(ximage, value)
XImage *ximage;
long value;

Arguments

ximageSpecifies a pointer to the image to be modified. 

valueSpecifies the constant value that is to be added.  Valid pixel value ranges depend on the visual used to create the image.  If this value added to the existing value causes an overflow, extra bits in the result are truncated. 

Description

XAddPixel() adds a constant value to every pixel value in an image.  This function is useful when you have a base pixel value derived from the allocation of color resources and need to manipulate an image so that the pixel values are in the same range.  For more information on images, 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;/* quantity 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 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

ImageByteOrder(), XCreateImage(), XDestroyImage(), XGetImage(), XGetPixel(), XGetSubImage(), XPutImage(), XPutPixel(), XSubImage(). 

Copyright O’Reilly & Assoc.  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026