Initialize a Photon image
PhImage_t *PiInitImage( PhImage_t *oldImage,
PhRect_t const *oldRect,
int colors )
- A pointer to a PhImage_t structure that defines the image parameters to use to initialize the new image.
- A rectangle that defines an area within oldImage to use to initialize the new image. If passed as NULL, the entire rectangle representing oldImage is used.
- A location where the function can fill in a rectangle that describes the area of the new image.
- The type of the new image. This must be one of the Pg_IMAGE_* types defined for PhImage_t. See Image types for a list of defined types. If this argument is 0, the type from oldImage is used.
- Dictates special behavior of the initialization process and can take the following values:
- Checks that the coordinates in oldRect make sense. If you set this flag bit, the function uses (0,0) for the upper-left corner if the coordinates in oldRect are negative. It also uses the image's lower-left corner coordinates, if the lower-left corner coordinates in oldRect are too large.
- Store the newly created image data in shared memory. This is useful
if you require fast rendering of the image.
- Copy the palette of the old image. If not specified, the new image palette is NULL.
This function initializes a new, empty Photon image based on the parameters of an existing image, copying all the PhImage_t structure members, and allocating a new image data buffer the same size as the old image's data buffer. If you specify the Pi_USE_COLORS flag bit, this function also copies the old image palette. You can optionally initialize a smaller image by passing in oldRect.
To duplicate an existing image, use PiDuplicateImage().
A pointer to the new, empty image on success, or NULL if an
in the Raw Drawing and Animation chapter of the
Photon Programmer's Guide