[Previous] [Contents] [Index] [Next]

PgDrawRepImage(), PgDrawRepImagemx()

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 PgDrawRepImagemx( 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 );

Description:

The PgDrawRepImage() and PgDrawRepImagemx() functions build a command in the draw buffer to repeatedly draw the image pointed to by ptr. These functions:

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 PgDrawImage(). 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. To calculate the tag, use PxCRC(). This argument is ignored if you set it to 0.


Note: If you call the "mx" form 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() before you modify the image.

If the data is in shared memory, the mx form 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(), PgDrawRepBitmapmx(), PgFlush(), PxCRC(), PxLoadImage()


[Previous] [Contents] [Index] [Next]