TGUI  0.9-beta
tgui::BackendTextureBase Class Referenceabstract

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 loadFromFile (const String &filename)=0
 Loads the texture from a file. More...
 
virtual bool loadFromPixelData (Vector2u size, const std::uint8_t *pixels)=0
 Loads the texture from an array of 32-bits RGBA pixels. More...
 
virtual Vector2u getSize () const =0
 Returns the size of the entire image. More...
 
virtual void setSmooth (bool smooth)=0
 Changes whether the smooth filter is enabled or not. More...
 
virtual bool isSmooth () const =0
 Returns whether the smooth filter is enabled or not. More...
 
virtual bool isTransparentPixel (Vector2u pixel) const =0
 Checks if a certain pixel is transparent. More...
 

Detailed Description

Base class for texture implementations that depend on the backend.

Member Function Documentation

◆ getSize()

virtual Vector2u tgui::BackendTextureBase::getSize ( ) const
pure virtual

Returns the size of the entire image.

Returns
Texture size

◆ isSmooth()

virtual bool tgui::BackendTextureBase::isSmooth ( ) const
pure virtual

Returns whether the smooth filter is enabled or not.

Returns
True if smoothing is enabled, false if it is disabled

◆ isTransparentPixel()

virtual bool tgui::BackendTextureBase::isTransparentPixel ( Vector2u  pixel) const
pure virtual

Checks if a certain pixel is transparent.

Parameters
pixelCoordinate of the pixel
Returns
True when the pixel is transparent, false when it is not

◆ loadFromFile()

virtual bool tgui::BackendTextureBase::loadFromFile ( const String filename)
pure virtual

Loads the texture from a file.

Parameters
filenameFilename of the image to load
Returns
True if the image was loaded successfully, false on failure

◆ loadFromPixelData()

virtual bool tgui::BackendTextureBase::loadFromPixelData ( Vector2u  size,
const std::uint8_t *  pixels 
)
pure virtual

Loads the texture from an array of 32-bits RGBA pixels.

Parameters
sizeWidth and height of the image to create
pixelsPointer to array of size.x*size.y*4 bytes with RGBA pixels, or a nullptr to create an empty texture

◆ setSmooth()

virtual void tgui::BackendTextureBase::setSmooth ( bool  smooth)
pure 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: