Base class for texture implementations that depend on the backend.
More...
#include <TGUI/Backend/Renderer/BackendTexture.hpp>
|
| BackendTexture (const BackendTexture &)=delete |
|
| BackendTexture (BackendTexture &&)=delete |
|
BackendTexture & | operator= (const BackendTexture &)=delete |
|
BackendTexture & | operator= (BackendTexture &&)=delete |
|
| BackendTexture ()=default |
| Default constructor.
|
|
virtual | ~BackendTexture ()=default |
| Virtual destructor.
|
|
bool | load (Vector2u size, std::unique_ptr< std::uint8_t[]> pixels, bool smooth) |
| Loads the texture from an array of 32-bits RGBA pixels.
|
|
virtual bool | loadTextureOnly (Vector2u size, const std::uint8_t *pixels, bool smooth) |
| Loads the texture from an array of 32-bits RGBA pixels, but don't take ownership of the pixels.
|
|
TGUI_NODISCARD Vector2u | getSize () const |
| Returns the size of the entire image.
|
|
virtual void | setSmooth (bool smooth) |
| Changes whether the smooth filter is enabled or not.
|
|
TGUI_NODISCARD bool | isSmooth () const |
| Returns whether the smooth filter is enabled or not.
|
|
TGUI_NODISCARD bool | isTransparentPixel (Vector2u pixel) const |
| Checks if a certain pixel is transparent.
|
|
TGUI_NODISCARD const std::uint8_t * | getPixels () const |
| Returns a pointer to the pixels (read-only)
|
|
|
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.
◆ getPixels()
TGUI_NODISCARD const std::uint8_t * tgui::BackendTexture::getPixels |
( |
| ) |
const |
Returns a pointer to the pixels (read-only)
- Returns
- Pointer to getSize().x * getSize().y * 4 bytes of RGBA pixels, or nullptr if the pixel data isn't stored.
◆ getSize()
TGUI_NODISCARD Vector2u tgui::BackendTexture::getSize |
( |
| ) |
const |
Returns the size of the entire image.
- Returns
- Texture size
◆ isSmooth()
TGUI_NODISCARD bool tgui::BackendTexture::isSmooth |
( |
| ) |
const |
Returns whether the smooth filter is enabled or not.
- Returns
- True if smoothing is enabled, false if it is disabled
◆ isTransparentPixel()
TGUI_NODISCARD bool tgui::BackendTexture::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()
bool tgui::BackendTexture::load |
( |
Vector2u | size, |
|
|
std::unique_ptr< std::uint8_t[]> | pixels, |
|
|
bool | smooth ) |
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 |
smooth | Should the smooth filter be enabled or not? |
◆ loadTextureOnly()
virtual bool tgui::BackendTexture::loadTextureOnly |
( |
Vector2u | size, |
|
|
const std::uint8_t * | pixels, |
|
|
bool | smooth ) |
|
virtual |
◆ setSmooth()
virtual void tgui::BackendTexture::setSmooth |
( |
bool | smooth | ) |
|
|
virtual |
The documentation for this class was generated from the following file: