FastUIDraw
|
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>
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 |
ImageSourceBase defines the inteface for copying texel data from a source (CPU memory, a file, etc) to an AtlasColorBackingStoreBase derived object.
|
pure virtual |
To be implemented by a derived class to return true if a region (across all mipmap levels) has a constant color.
location | location at LOD 0 |
square_size | width and height of region to check |
dst | if all have texels of the region have the same color, write that color value to dst. |
Implemented in fastuidraw::ImageSourceCArray.
|
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.
level | LOD 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 |
w | width of data from which to copy |
h | height of data from which to copy |
dst | location 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.
|
pure virtual |
To be implemented by a derived class to return the format of the image data.
Implemented in fastuidraw::ImageSourceCArray.
|
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.