FastUIDraw
Public Member Functions | List of all members
fastuidraw::ImageSourceBase Class Referenceabstract

ImageSourceBase defines the inteface for copying texel data from a source (CPU memory, a file, etc) to an AtlasColorBackingStoreBase derived object. More...

#include <image.hpp>

Inheritance diagram for fastuidraw::ImageSourceBase:
Inheritance graph
[legend]

Public Member Functions

virtual bool all_same_color (ivec2 location, int square_size, u8vec4 *dst) const =0
 
virtual void fetch_texels (unsigned int level, ivec2 location, unsigned int w, unsigned int h, c_array< u8vec4 > dst) const =0
 
virtual enum Image::format_t format (void) const =0
 
virtual unsigned int number_levels (void) const =0
 

Detailed Description

ImageSourceBase defines the inteface for copying texel data from a source (CPU memory, a file, etc) to an AtlasColorBackingStoreBase derived object.

Definition at line 234 of file image.hpp.

Member Function Documentation

◆ all_same_color()

virtual bool fastuidraw::ImageSourceBase::all_same_color ( ivec2  location,
int  square_size,
u8vec4 dst 
) const
pure virtual

To be implemented by a derived class to return true if a region (across all mipmap levels) has a constant color.

Parameters
locationlocation at LOD 0
square_sizewidth and height of region to check
dstif all have texels of the region have the same color, write that color value to dst.

Implemented in fastuidraw::ImageSourceCArray.

◆ fetch_texels()

virtual void fastuidraw::ImageSourceBase::fetch_texels ( unsigned int  level,
ivec2  location,
unsigned int  w,
unsigned int  h,
c_array< u8vec4 dst 
) const
pure virtual

To be implemented by a derived class to write to a c_array of u8vec4 data a rectangle of texels of a particular mipmap level. NOTE: if pixels are requested to be fetched from outside the sources natural dimensions, those pixels outside are to be duplicates of the boundary values.

Parameters
levelLOD of data where 0 represents the highest level of detail and each successive level is half the resolution in each dimension; it is gauranteed by the called that 0 <= level() < number_levels()
location(x, y) location of data from which to copy
wwidth of data from which to copy
hheight of data from which to copy
dstlocation to which to write data, data is to be packed dst[x + w * y] holds the texel data (x + location.x(), y + location.y()) with 0 <= x < w and 0 <= y < h

Implemented in fastuidraw::ImageSourceCArray.

◆ format()

virtual enum Image::format_t fastuidraw::ImageSourceBase::format ( void  ) const
pure virtual

To be implemented by a derived class to return the format of the image data.

Implemented in fastuidraw::ImageSourceCArray.

◆ number_levels()

virtual unsigned int fastuidraw::ImageSourceBase::number_levels ( void  ) const
pure virtual

To be implemented by a derived class to return the number of levels (including the base-image) of image source has, i.e. if the image is to have no mipmapping, return 1.

Implemented in fastuidraw::ImageSourceCArray.


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