Public Member Functions |
| Image () |
| Default constructor.
|
| Image (const Image ©) |
| Copy constructor.
|
| ~Image () |
| Destructor.
|
bool | LoadFromFile (const std::string &filename) |
| Load the image from a file.
|
bool | LoadFromMemory (const void *data, std::size_t sizeInBytes) |
| Load the image from a file in memory.
|
bool | LoadFromPixels (unsigned int width, unsigned int height, const Uint8 *pixels) |
| Load the image directly from an array of pixels.
|
bool | SaveToFile (const std::string &filename) const |
| Save the content of the image to a file.
|
bool | Create (unsigned int width, unsigned int height, const Color &color=Color(0, 0, 0)) |
| Create an empty image.
|
void | CreateMaskFromColor (const Color &transparentColor, Uint8 alpha=0) |
| Create transparency mask from a specified colorkey.
|
void | Copy (const Image &source, unsigned int destX, unsigned int destY, const IntRect &sourceRect=IntRect(0, 0, 0, 0), bool applyAlpha=false) |
| Copy pixels from another image onto this one.
|
bool | CopyScreen (RenderWindow &window, const IntRect &sourceRect=IntRect(0, 0, 0, 0)) |
| Create the image from the current contents of the given window.
|
void | SetPixel (unsigned int x, unsigned int y, const Color &color) |
| Change the color of a pixel.
|
const Color & | GetPixel (unsigned int x, unsigned int y) const |
| Get a pixel from the image.
|
const Uint8 * | GetPixelsPtr () const |
| Get a read-only pointer to the array of pixels (RGBA 8 bits integers components) Array size is GetWidth() x GetHeight() x 4 This pointer becomes invalid if you reload or resize the image.
|
void | UpdatePixels (const Uint8 *pixels) |
| Update the whole image from an array of pixels.
|
void | UpdatePixels (const Uint8 *pixels, const IntRect &rectangle) |
| Update a sub-rectangle of the image from an array of pixels.
|
void | Bind () const |
| Bind the image for rendering.
|
void | SetSmooth (bool smooth) |
| Enable or disable image smooth filter.
|
unsigned int | GetWidth () const |
| Return the width of the image.
|
unsigned int | GetHeight () const |
| Return the height of the image.
|
bool | IsSmooth () const |
| Tells whether the smooth filtering is enabled or not.
|
FloatRect | GetTexCoords (const IntRect &rectangle) const |
| Convert a subrect expressed in pixels, into float texture coordinates.
|
Image & | operator= (const Image &other) |
| Assignment operator.
|
Static Public Member Functions |
static unsigned int | GetMaximumSize () |
| Get the maximum image size according to hardware support.
|
static unsigned int | GetValidSize (unsigned int size) |
| Get a valid image size according to hardware support.
|
Friends |
class | Renderer |
class | RenderImage |
void sf::Image::UpdatePixels |
( |
const Uint8 * |
pixels, |
|
|
const IntRect & |
rectangle | |
|
) |
| | |
Update a sub-rectangle of the image from an array of pixels.
Warning: for performances reasons, this function doesn't perform any check; thus you're responsible of ensuring that rectangle does not exceed the image size, and that pixels contains enough elements.
- Parameters:
-
| rectangle | : Sub-rectangle of the image to update |
| pixels | : Array of pixels to write to the image |
Definition at line 468 of file Image.cpp.