#include <SFML/Config.h>
#include <SFML/Graphics/Color.h>
Go to the source code of this file.
Typedefs | |
typedef sfImage | sfImage |
sfImage is the low-level class for loading and manipulating images | |
Functions | |
CSFML_API sfImage * | sfImage_Create () |
Create a new empty image. | |
CSFML_API sfImage * | sfImage_CreateFromColor (unsigned int Width, unsigned int Height, sfColor Color) |
Create a new image filled with a color. | |
CSFML_API sfImage * | sfImage_CreateFromPixels (unsigned int Width, unsigned int Height, const sfUint8 *Data) |
Create a new image from an array of pixels in memory. | |
CSFML_API sfImage * | sfImage_CreateFromFile (const char *Filename) |
Create a new image from a file. | |
CSFML_API sfImage * | sfImage_CreateFromMemory (const char *Data, size_t SizeInBytes) |
Create a new image from a file in memory. | |
CSFML_API void | sfImage_Destroy (sfImage *Image) |
Destroy an existing image. | |
CSFML_API sfBool | sfImage_SaveToFile (sfImage *Image, const char *Filename) |
Save the content of an image to a file. | |
CSFML_API void | sfImage_CreateMaskFromColor (sfImage *Image, sfColor ColorKey, sfUint8 Alpha) |
Create a transparency mask for an image from a specified colorkey. | |
CSFML_API sfBool | sfImage_Resize (sfImage *Image, unsigned int Width, unsigned int Height, sfColor Color) |
Resize an image - warning : this function does not scale the image, it just ajdusts size (add padding or remove pixels). | |
CSFML_API void | sfImage_SetPixel (sfImage *Image, unsigned int X, unsigned int Y, sfColor Color) |
Change the color of a pixel of an image Don't forget to call Update when you end modifying pixels. | |
CSFML_API sfColor | sfImage_GetPixel (sfImage *Image, unsigned int X, unsigned int Y) |
Get a pixel from an image. | |
CSFML_API const sfUint8 * | sfImage_GetPixelsPtr (sfImage *Image) |
Get a read-only pointer to the array of pixels of an image (8 bits integers RGBA) Array size is sfImage_GetWidth() x sfImage_GetHeight() x 4 This pointer becomes invalid if you reload or resize the image. | |
CSFML_API void | sfImage_Bind (sfImage *Image) |
Bind the image for rendering. | |
CSFML_API void | sfImage_SetSmooth (sfImage *Image, sfBool Smooth) |
Enable or disable image smooth filter. | |
CSFML_API unsigned int | sfImage_GetWidth (sfImage *Image) |
Return the width of the image. | |
CSFML_API unsigned int | sfImage_GetHeight (sfImage *Image) |
Return the height of the image. | |
CSFML_API sfBool | sfImage_IsSmooth (sfImage *Image) |
Tells whether the smoothing filter is enabled or not on an image. |
CSFML_API void sfImage_Bind | ( | sfImage * | Image | ) |
Bind the image for rendering.
Image | : Image to bind |
CSFML_API sfImage* sfImage_Create | ( | ) |
Create a new empty image.
CSFML_API sfImage* sfImage_CreateFromColor | ( | unsigned int | Width, | |
unsigned int | Height, | |||
sfColor | Color | |||
) |
Create a new image filled with a color.
Width | : Image width | |
Height | : Image height | |
Col | : Image color |
CSFML_API sfImage* sfImage_CreateFromFile | ( | const char * | Filename | ) |
Create a new image from a file.
Filename | : Path of the image file to load |
CSFML_API sfImage* sfImage_CreateFromMemory | ( | const char * | Data, | |
size_t | SizeInBytes | |||
) |
Create a new image from a file in memory.
Data | : Pointer to the file data in memory | |
SizeInBytes | : Size of the data to load, in bytes |
CSFML_API sfImage* sfImage_CreateFromPixels | ( | unsigned int | Width, | |
unsigned int | Height, | |||
const sfUint8 * | Data | |||
) |
Create a new image from an array of pixels in memory.
Width | : Image width | |
Height | : Image height | |
Data | : Pointer to the pixels in memory (assumed format is RGBA) |
Create a transparency mask for an image from a specified colorkey.
Image | : Image to modify | |
ColorKey | : Color to become transparent | |
Alpha | : Alpha value to use for transparent pixels |
CSFML_API void sfImage_Destroy | ( | sfImage * | Image | ) |
Destroy an existing image.
Image | : Image to delete |
CSFML_API unsigned int sfImage_GetHeight | ( | sfImage * | Image | ) |
Return the height of the image.
Image | : Image to read |
Get a pixel from an image.
Image | : Image to read | |
X | : X coordinate of pixel in the image | |
Y | : Y coordinate of pixel in the image |
CSFML_API const sfUint8* sfImage_GetPixelsPtr | ( | sfImage * | Image | ) |
Get a read-only pointer to the array of pixels of an image (8 bits integers RGBA) Array size is sfImage_GetWidth() x sfImage_GetHeight() x 4 This pointer becomes invalid if you reload or resize the image.
Image | : Image to read |
CSFML_API unsigned int sfImage_GetWidth | ( | sfImage * | Image | ) |
Return the width of the image.
Image | : Image to read |
Tells whether the smoothing filter is enabled or not on an image.
Image | : Image to read |
CSFML_API sfBool sfImage_Resize | ( | sfImage * | Image, | |
unsigned int | Width, | |||
unsigned int | Height, | |||
sfColor | Color | |||
) |
Resize an image - warning : this function does not scale the image, it just ajdusts size (add padding or remove pixels).
Image | : Image to resize | |
Width | : New width | |
Height | : New height | |
Col | : Color to assign to new pixels |
Save the content of an image to a file.
Image | : Image to save | |
Filename | : Path of the file to save (overwritten if already exist) |
Change the color of a pixel of an image Don't forget to call Update when you end modifying pixels.
Image | : Image to modify | |
X | : X coordinate of pixel in the image | |
Y | : Y coordinate of pixel in the image | |
Col | : New color for pixel (X, Y) |
Enable or disable image smooth filter.
Image | : Image to modify | |
Smooth | : sfTrue to enable smoothing filter, false to disable it |