An Image represents an image comprising of RGBA8 values. The texel values themselves are stored in a ImageAtlas.
More...
#include <image.hpp>
An Image represents an image comprising of RGBA8 values. The texel values themselves are stored in a ImageAtlas.
Definition at line 44 of file image.hpp.
◆ format_t
Enumeration to describe the format of an image
Enumerator |
---|
rgba_format | Image is non-premultiplied RGBA format (each color channel of each pixel taking 8-bits).
|
premultipied_rgba_format | Image is RGBA format (each color channel of each pixel taking 8-bits) with the RGB channels pre-multiplied by the alpha channel.
|
Definition at line 50 of file image.hpp.
◆ type_t
Gives the image-type of an Image
Enumerator |
---|
on_atlas | Indicates that the Image is on an ImageAtlas. Such images will not introcude draw-breaks, but are more complicated to sample from.
|
bindless_texture2d | Indicates that the Image is backed by a gfx API texture via a bindless interface. Such images do not introduce draw-breaks and are simple from. The only draw back, is that not all 3D API implementations support bindless texruing (for example the GL/GLES backends require that the GL/GLES implementation support an extension.
|
context_texture2d | Indicates to source the Image data from a currently bound texture of the 3D API context. These image are simple to sample from but introduce draw breaks. Using images of these types should be avoided at all costs since whenever one uses Image objects of these types the 3D API state needs to change which induces a stage change and draw break, harming performance.
|
Definition at line 69 of file image.hpp.
◆ Image()
Protected ctor for creating an Image backed by a bindless texture; Backends should use this ctor for Image deried classes that do cleanup (for example releasing the handle and/or deleting the texture).
- Parameters
-
atlas | ImageAtlas atlas onto which to place the image. |
w | width of underlying texture |
h | height of underlying texture |
m | number of mipmap levels of the image |
type | the type of the bindless texture, must NOT have value on_atlas. |
fmt | the format of the image |
handle | the bindless handle value used by the Gfx API in shaders to reference the texture. |
action | action to call to release backing resources of the created Image. |
◆ bindless_handle()
uint64_t fastuidraw::Image::bindless_handle |
( |
void |
| ) |
const |
◆ dimensions()
ivec2 fastuidraw::Image::dimensions |
( |
void |
| ) |
const |
Returns the dimensions of the image, i.e the width and height.
◆ dimensions_index_divisor()
float fastuidraw::Image::dimensions_index_divisor |
( |
void |
| ) |
const |
◆ format()
enum format_t fastuidraw::Image::format |
( |
void |
| ) |
const |
Returns the format of the image.
◆ master_index_tile()
ivec3 fastuidraw::Image::master_index_tile |
( |
void |
| ) |
const |
Returns the "head" index tile as returned by ImageAtlas::add_index_tile() or ImageAtlas::add_index_tile_index_data().
Only applies when type() returns on_atlas.
◆ master_index_tile_dims()
vec2 fastuidraw::Image::master_index_tile_dims |
( |
void |
| ) |
const |
◆ number_index_lookups()
unsigned int fastuidraw::Image::number_index_lookups |
( |
void |
| ) |
const |
Returns the number of index look-ups to get to the image data.
Only applies when type() returns on_atlas.
◆ number_mipmap_levels()
unsigned int fastuidraw::Image::number_mipmap_levels |
( |
void |
| ) |
const |
Returns the number of mipmap levels the image supports.
◆ type()
type_t fastuidraw::Image::type |
( |
void |
| ) |
const |
The documentation for this class was generated from the following file:
- /home/kevin/fastuidraw.krogueintel/inc/fastuidraw/image.hpp