An implementation of ImageSourceBase where the data is backed by a c_array<const u8vec4> data.
More...
#include <image.hpp>
An implementation of ImageSourceBase where the data is backed by a c_array<const u8vec4> data.
Definition at line 304 of file image.hpp.
◆ ImageSourceCArray()
Ctor.
- Parameters
-
dimensions | width and height of the LOD level 0 mipmap; the LOD level n is then assumed to be size (dimensions.x() >> n, dimensions.y() >> n) |
pdata | the texel data, the data is NOT copied, thus the contents backing the texel data must not be freed until the ImageSourceCArray goes out of scope. |
fmt | the format of the image data |
◆ all_same_color()
virtual bool fastuidraw::ImageSourceCArray::all_same_color |
( |
ivec2 |
location, |
|
|
int |
square_size, |
|
|
u8vec4 * |
dst |
|
) |
| const |
|
virtual |
To be implemented by a derived class to return true if a region (across all mipmap levels) has a constant color.
- Parameters
-
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. |
Implements fastuidraw::ImageSourceBase.
◆ fetch_texels()
virtual void fastuidraw::ImageSourceCArray::fetch_texels |
( |
unsigned int |
level, |
|
|
ivec2 |
location, |
|
|
unsigned int |
w, |
|
|
unsigned int |
h, |
|
|
c_array< u8vec4 > |
dst |
|
) |
| const |
|
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
-
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 |
Implements fastuidraw::ImageSourceBase.
◆ format()
virtual enum Image::format_t fastuidraw::ImageSourceCArray::format |
( |
void |
| ) |
const |
|
virtual |
◆ number_levels()
virtual unsigned int fastuidraw::ImageSourceCArray::number_levels |
( |
void |
| ) |
const |
|
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.
Implements fastuidraw::ImageSourceBase.
The documentation for this class was generated from the following file:
- /home/kevin/fastuidraw.krogueintel/inc/fastuidraw/image.hpp