TGUI  0.9.5
Loading...
Searching...
No Matches
tgui::BackendTextureBase Class Reference

Base class for texture implementations that depend on the backend. More...

#include <TGUI/BackendTexture.hpp>

Public Member Functions

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.
 

Protected Attributes

Vector2u m_imageSize
 
std::unique_ptr< std::uint8_t[]> m_pixels
 
bool m_isSmooth = true
 

Detailed Description

Base class for texture implementations that depend on the backend.

Member Function Documentation

◆ 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
pixelCoordinate 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
sizeWidth and height of the image to create
pixelsMoved 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
smoothTrue if smoothing should be enabled, false if it should be disabled

The documentation for this class was generated from the following file: