Rotate an image
#include <photon/PxImage.h> int PxRotateImage( PhImage_t const *src, PhImage_t *dst, unsigned angle, PxMethods_t const *methods );
phexlib
This function reads a graphic file into memory. Photon supports at least the BMP, GIF, JPEG, PCX, PNG, and SGI file formats.
To load an image, call PxLoadImage(); to draw an image, call PgDrawPhImage() or PgDrawPhImagemx().
When you're finished with the image, you can free the allocated members of the image structure by calling PhReleaseImage() after setting the image's flag member to indicate which parts of the image should be freed. You can then free the PhImage_t structure. For more information, see PhImage_t.
The PxMethods_t structure alters how PxRotateImage() behaves. The only methods that PxRotateImage() uses (if specified) are px_alloc, px_free, and px_error: void *(*px_error)( char *msg ); An error routine that you supply. The loader calls this function if it encounters a fatal error while loading the graphic file. The msg argument is a pointer to an error string.
Your px_alloc function must return a pointer to the allocated memory.
Before calling this function, PxRotateImage() frees all of the memory that it allocated |
PxRotateImage() doesn't use the value that px_free, px_error, px_warning, and px_progress return. These functions can return NULL to avoid compiler warnings. |
0 on success, or 1 if an error occurred.
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PgDrawPhImage*(), PgDrawPhImageRect*(), PgDrawRepPhImage*(), PgSetPalette(), PgSetFillColor(), PgSetTextColor(), PgShmemCleanup(), PhCreateImage(), PhImage_t, PhMakeGhostBitmap(), PhMakeTransBitmap(), PhMakeTransparent(), PhReleaseImage(), PtCRC(), PtCRCValue(), PxLoadImage(), PxTerminate()
“Images” in the Raw Drawing and Animation chapter of the Photon Programmer's Guide