#include <SFML/Config.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
Go to the source code of this file.
Typedefs | |
typedef sfRenderWindow | sfRenderWindow |
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 void | sfImage_Copy (sfImage *Image, sfImage *Source, unsigned int DestX, unsigned int DestY, sfIntRect SourceRect) |
Copy pixels from another image onto this one. | |
CSFML_API sfBool | sfImage_CopyScreen (sfImage *Image, sfRenderWindow *Window, sfIntRect SourceRect) |
Create the image from the current contents of the given window. | |
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. |
typedef struct sfRenderWindow sfRenderWindow |
CSFML_API void sfImage_Bind | ( | sfImage * | Image | ) |
Bind the image for rendering.
Image | : Image to bind |
CSFML_API void sfImage_Copy | ( | sfImage * | Image, | |
sfImage * | Source, | |||
unsigned int | DestX, | |||
unsigned int | DestY, | |||
sfIntRect | SourceRect | |||
) |
Copy pixels from another image onto this one.
This function does a slow pixel copy and should only be used at initialization time
Image | : Destination image | |
Source | : Source image to copy | |
DestX | : X coordinate of the destination position | |
DestY | : Y coordinate of the destination position | |
SourceRect | : Sub-rectangle of the source image to copy |
CSFML_API sfBool sfImage_CopyScreen | ( | sfImage * | Image, | |
sfRenderWindow * | Window, | |||
sfIntRect | SourceRect | |||
) |
Create the image from the current contents of the given window.
Image | : Destination image | |
Window | : Window to capture | |
SourceRect | : Sub-rectangle of the screen to copy (empty by default - entire image) |
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 |
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 |