PgDrawRepImage(), PgDrawRepImagev(), PgDrawRepImageCx(), PgDrawRepImageCxv()

Draw an image several times

Synopsis:

int PgDrawRepImage( void const *ptr,
                    int flag,
                    PhPoint_t const *pos,
                    PhPoint_t const *area,
                    int bpl,
                    PhPoint_t const *rep,
                    PhPoint_t const *space,
                    long tag );

int PgDrawRepImagev( void const *ptr,
                     int flag,
                     PhPoint_t const *pos,
                     PhPoint_t const *area,
                     int bpl,
                     PhPoint_t const *rep,
                     PhPoint_t const *space,
                     long tag );

int PgDrawRepImageCx( void *dc,
                      void const *ptr,
                      int flag,
                      PhPoint_t const *pos,
                      PhPoint_t const *area,
                      int bpl,
                      PhPoint_t const *rep,
                      PhPoint_t const *space,
                      long tag );

int PgDrawRepImageCxv( void *dc,
                       void const *ptr,
                       int flag,
                       PhPoint_t const *pos,
                       PhPoint_t const *area,
                       int bpl,
                       PhPoint_t const *rep,
                       PhPoint_t const *space,
                       long tag );

Library:

ph

Description:

These functions build a command in the draw buffer to repeatedly draw the image pointed to by ptr. These functions:

PgDrawRepImage() and PgDrawRepImagev() work on the current draw context, while you can specify the draw context dc for PgDrawRepImageCx() and PgDrawRepImageCxv().

If you OR flags with Pg_REPBM_ALTERNATE, all the images are drawn twice; the second time the position is offset by half of space.x and space.y.

The image formats are as described for PhImage_t. Specify the image format by ORing it into the flags argument.

The bpl argument indicates the number of bytes per line of image data (that is, the offset from one line of data to the next). To calculate the size of the data transferred to the graphics driver, multiply bpl by size.y. You can determine the size and bpl arguments with the value returned by PxLoadImage().

The tag argument is used for data caching by programs such as phrelay (see the QNX Neutrino Utilities Reference). To calculate the tag, use PtCRC(). This argument is ignored if you set it to 0.


Note: If you call the “v” forms of this function, the data isn't physically copied into the draw buffer. Instead, a pointer to the image is stored until the draw buffer is flushed. Make sure you call PgFlush() or PgFlushCx() before you modify the image.

If the data is in shared memory, the “v” forms of this function automatically passes a shared memory reference instead of the image.


Returns:

0
Success.
-1
The draw buffer is too small to hold the current draw state, the draw command, and one pixel line of the image. Increase the size of the draw buffer, or decrease the width of the image.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgDrawImage*(), PgDrawRepBitmap*(), PgDrawRepPhImage*(), PgFlush*(), PhImage_t, PhPoint_t, PtCRC(), PxLoadImage()

Images in the Raw Drawing and Animation chapter of the Photon Programmer's Guide