Description
PnImage objects contain two buffers containing images. The 'image buffer'
is the main, or 'front', buffer. This is where all rendering is done, and
where the actual image is. The 'transform buffer' is a temporary buffer that
is used by actuators that affect every pixel in the image. These transform
actuators must first set the value of every pixel in the transform buffer;
they then must call pn_image_apply_transform() to render the transform buffer
onto the image buffer.
Details
pn_image_new ()
Creates a new PnImage object
pn_image_set_size ()
void pn_image_set_size (PnImage *image,
guint width,
guint height); |
Sets the size of the image contained in a PnImage object
pn_image_get_width ()
guint pn_image_get_width (PnImage *image); |
Gets the width of a PnImage
pn_image_get_height ()
guint pn_image_get_height (PnImage *image); |
Gets the height of a PnImage
pn_image_get_pitch ()
guint pn_image_get_pitch (PnImage *image); |
Gets the pitch (width in bytes) of a PnImage
enum PnBlendMode
typedef enum
{
PN_BLEND_MODE_IGNORE, /* Ignore the source image */
PN_BLEND_MODE_REPLACE, /* Replace the destination image with the source */
PN_BLEND_MODE_5050, /* Use the mean of the source and destination images */
PN_BLEND_MODE_LAST /* INVALID */
} PnBlendMode; |
struct PnColor
struct PnColor
{
guint8 red;
guint8 green;
guint8 blue;
guint8 unused;
}; |
pn_image_get_image_buffer ()
Retrieves the image buffer (the 'front buffer') of a PnImage.
pn_image_get_transform_buffer ()
Retrieves the transform buffer (the 'back buffer') of a PnImage.
The transform buffer should only be used internally by transform
actuators. *EVERY* pixel in the transform buffer *MUST* be set.
The transform buffer can be 'copied' to the image buffer using
pn_image_apply_transform().
pn_image_render_pixel ()
void pn_image_render_pixel (PnImage *image,
guint x,
guint y,
PnColor color); |
Renders a pixel to the image buffer of a PnImage. pn_image_set_render_mode()
can be used to set the blend mode that is used by this function.
pn_image_render_pixel_by_offset ()
void pn_image_render_pixel_by_offset (PnImage *image,
guint offset,
PnColor color); |
Renders a pixel to the image buffer of a PnImage based on a pixel offset rather than
rectangular coordinates. This function should be used if there is a more optimum way
to calculate the offset than multiplying at every pixel. pn_image_set_render_mode()
can be used to set the blend mode that is used by this function.
pn_image_render_line ()
void pn_image_render_line (PnImage *image,
guint x0,
guint y0,
guint x1,
guint y1,
PnColor color); |
Renders a line from (x0,y0) to (x1,y1) to the image buffer of a PnImage.
Currently ***NO CLIPPING IS CURRENTLY DONE!!!***
pn_image_apply_transform ()
void pn_image_apply_transform (PnImage *image); |
Renders the transform buffer onto the image buffer.
pn_image_set_transform_mode() may be used to set the blend mode that is
used by this function.
pn_image_render_image ()
Renders the image buffer of src onto the image buffer of an image.