FastUIDraw
|
A PainterImageBrushShaderData defines the PainterBrushShaderData that the shaders of a PainterImageBrushShader consume. It specifies what Image and what rectangular region within it from which to source image data. More...
#include <painter_image_brush_shader_data.hpp>
Public Member Functions | |
PainterImageBrushShaderData (void) | |
PainterImageBrushShaderData (const PainterImageBrushShaderData &obj) | |
c_array< const reference_counted_ptr< const Image > > | bind_images (void) const override |
unsigned int | data_size (void) const override |
void | image (const reference_counted_ptr< const Image > &im) |
const reference_counted_ptr< const Image > & | image (void) const |
unsigned int | number_resources (void) const override |
PainterImageBrushShaderData & | operator= (const PainterImageBrushShaderData &rhs) |
void | pack_data (c_array< uvec4 > dst) const override |
void | save_resources (c_array< reference_counted_ptr< const resource_base > > dst) const override |
void | sub_image (const reference_counted_ptr< const Image > &im, uvec2 xy, uvec2 wh) |
A PainterImageBrushShaderData defines the PainterBrushShaderData that the shaders of a PainterImageBrushShader consume. It specifies what Image and what rectangular region within it from which to source image data.
Definition at line 43 of file painter_image_brush_shader_data.hpp.
Bit packing for the master index tile of a Image.
Enumerator | |
---|---|
atlas_location_x_num_bits | number bits to encode Image::master_index_tile().x() |
atlas_location_y_num_bits | number bits to encode Image::master_index_tile().y() |
atlas_location_z_num_bits | number bits to encode Image::master_index_tile().z() |
atlas_location_x_bit0 | bit where Image::master_index_tile().x() is encoded |
atlas_location_y_bit0 | bit where Image::master_index_tile().y() is encoded |
atlas_location_z_bit0 | bit where Image::master_index_tile().z() is encoded |
Definition at line 65 of file painter_image_brush_shader_data.hpp.
Offsets for image data packing. The offsets are in units of uint32_t, NOT units of uvec4.
Enumerator | |
---|---|
size_xy_offset | Width and height of the sub-rectangle of the Image from which to source and encoded in a single uint32_t. The bits are packed as according to uvec2_encoding. If there is no valid backing image, then the encoded value will be 0. |
start_xy_offset | The minx-miny corener of the sub-rectangle of the Image from which to source and encoded in a single uint32_t. The bits are packed as according to uvec2_encoding. |
atlas_location_xyz_offset | Location of image (Image::master_index_tile()) in the image atlas is encoded in a single uint32. The bits are packed as according to atlas_location_encoding. If the image is not of type Image::on_atlas, gives the high 32-bits of Image::handle(). |
number_lookups_offset | Holds the amount the number of index looks ups, see Image::number_index_lookups(). If the image is not of type Image::on_atlas, gives the low 32-bits of Image::handle(). |
shader_data_size | Number of elements packed for image support for a brush |
bindless_handle_hi_offset | Offset to the high 32-bits of the handle value when the Image is of type Image::bindless_texture2d. |
bindless_handle_low_offset | Offset to the low 32-bits of the handle value when the Image is of type Image::bindless_texture2d. |
Definition at line 89 of file painter_image_brush_shader_data.hpp.
Bit packing for an uvec2 value.
Definition at line 52 of file painter_image_brush_shader_data.hpp.
fastuidraw::PainterImageBrushShaderData::PainterImageBrushShaderData | ( | void | ) |
Ctor initializes to not source from any image data
|
inline |
Copy ctor.
Definition at line 151 of file painter_image_brush_shader_data.hpp.
|
overridevirtual |
To be implemented by a derived class to return a c_array of references to Image objects whose Image::type() value is Image::context_texture2d. The i'th entry in the returned array will be bound to the i'th external texture slot of the backend via the PainterDrawBreakAction objected returned by PainterBackend::bind_image(). Default implementation is to return an empty array.
Reimplemented from fastuidraw::PainterBrushShaderData.
|
overridevirtual |
To be implemented by a derived class to return the number of uvec4 blocks needed to pack the data.
Implements fastuidraw::PainterBrushShaderData.
void fastuidraw::PainterImageBrushShaderData::image | ( | const reference_counted_ptr< const Image > & | im | ) |
|
inline |
Returns the Image from which to source
Definition at line 191 of file painter_image_brush_shader_data.hpp.
|
overridevirtual |
To be optionally implemented by a derived class to return the number of resources that need to be resident after packing. Default implementation returns 0.
Reimplemented from fastuidraw::PainterBrushShaderData.
|
inline |
Assignment operator
Definition at line 161 of file painter_image_brush_shader_data.hpp.
|
overridevirtual |
To be implemented by a derived class to pack the data.
dst | location to which to pack the data |
Implements fastuidraw::PainterBrushShaderData.
|
overridevirtual |
To be optionally implemented by a derived class to save references to resources that need to be resident after packing. Default implementation does nothing.
dst | location to which to save resources. |
Reimplemented from fastuidraw::PainterBrushShaderData.
void fastuidraw::PainterImageBrushShaderData::sub_image | ( | const reference_counted_ptr< const Image > & | im, |
uvec2 | xy, | ||
uvec2 | wh | ||
) |