Base class for texture implementations that depend on the backend.
More...
#include <TGUI/BackendTexture.hpp>
|
virtual | ~BackendTextureBase ()=default |
| Virtual destructor.
|
|
virtual bool | load (Vector2u size, std::unique_ptr< std::uint8_t[]> pixels) |
| Loads the texture from an array of 32-bits RGBA pixels.
|
|
virtual Vector2u | getSize () const |
| Returns the size of the entire image.
|
|
virtual void | setSmooth (bool smooth) |
| Changes whether the smooth filter is enabled or not.
|
|
virtual bool | isSmooth () const |
| Returns whether the smooth filter is enabled or not.
|
|
bool | isTransparentPixel (Vector2u pixel) const |
| Checks if a certain pixel is transparent.
|
|
|
Vector2u | m_imageSize |
|
std::unique_ptr< std::uint8_t[]> | m_pixels |
|
bool | m_isSmooth = true |
|
Base class for texture implementations that depend on the backend.
◆ getSize()
virtual Vector2u tgui::BackendTextureBase::getSize |
( |
| ) |
const |
|
virtual |
Returns the size of the entire image.
- Returns
- Texture size
◆ isSmooth()
virtual bool tgui::BackendTextureBase::isSmooth |
( |
| ) |
const |
|
virtual |
Returns whether the smooth filter is enabled or not.
- Returns
- True if smoothing is enabled, false if it is disabled
◆ isTransparentPixel()
bool tgui::BackendTextureBase::isTransparentPixel |
( |
Vector2u |
pixel | ) |
const |
Checks if a certain pixel is transparent.
- Parameters
-
pixel | Coordinate of the pixel |
- Returns
- True when the pixel is transparent, false when it is not
◆ load()
virtual bool tgui::BackendTextureBase::load |
( |
Vector2u |
size, |
|
|
std::unique_ptr< std::uint8_t[]> |
pixels |
|
) |
| |
|
virtual |
Loads the texture from an array of 32-bits RGBA pixels.
- Parameters
-
size | Width and height of the image to create |
pixels | Moved pointer to array of size.x*size.y*4 bytes with RGBA pixels, or nullptr to create an empty texture |
◆ setSmooth()
virtual void tgui::BackendTextureBase::setSmooth |
( |
bool |
smooth | ) |
|
|
virtual |
Changes whether the smooth filter is enabled or not.
- Parameters
-
smooth | True if smoothing should be enabled, false if it should be disabled |
The documentation for this class was generated from the following file: