49 const void* initial_pixel_data =
nullptr);
59 [[nodiscard]] uint32_t
get_width()
const {
return m_width; }
60 [[nodiscard]] uint32_t
get_height()
const {
return m_height; }
71 [[nodiscard]] std::shared_ptr<Core::VKImage>
get_texture()
const {
return m_gpu_texture; }
72 [[nodiscard]]
bool has_texture()
const {
return m_gpu_texture !=
nullptr; }
88 void set_gpu_texture(std::shared_ptr<Core::VKImage>
image);
100 return m_texture_processor;
110 void set_pixel_data(
const void* data,
size_t size);
116 void mark_pixels_dirty();
129 void resize_texture(uint32_t new_width, uint32_t new_height);
142 void set_position(
float x,
float y);
151 void set_scale(
float width,
float height);
159 void set_rotation(
float angle_radians);
162 [[nodiscard]] glm::vec2
get_scale()
const {
return m_scale; }
169 void set_custom_vertices(
const std::vector<Nodes::TextureQuadVertex>& vertices);
175 void use_default_quad();
177 [[nodiscard]]
const std::vector<uint8_t>&
get_pixel_data()
const {
return m_pixel_data; }
188 virtual void setup_rendering(
const RenderConfig& config);
192 return m_render_processor;
202 m_texture_processor = processor;
217 bool m_texture_dirty =
true;
220 glm::vec2 m_position { 0.0F, 0.0F };
221 glm::vec2 m_scale { 1.0F, 1.0F };
222 float m_rotation { 0.0F };
223 bool m_geometry_dirty =
true;
227 bool m_uses_custom_vertices =
false;
234 void generate_default_quad();
235 void generate_quad_with_transform();
236 static size_t calculate_quad_vertex_size();
std::shared_ptr< TextureProcessor > get_texture_processor() const
uint32_t get_width() const
std::shared_ptr< TextureProcessor > m_texture_processor
std::shared_ptr< Core::VKImage > m_gpu_texture
Portal::Graphics::ImageFormat get_format() const
std::vector< uint8_t > m_pixel_data
void mark_texture_dirty()
std::shared_ptr< RenderProcessor > m_render_processor
bool is_texture_dirty() const
std::shared_ptr< RenderProcessor > get_render_processor() const override
Get a RenderProcessor suitable for rendering this buffer.
float get_rotation() const
~TextureBuffer() override=default
glm::vec2 get_scale() const
uint32_t get_height() const
glm::vec2 get_position() const
const std::vector< uint8_t > & get_pixel_data() const
std::shared_ptr< Core::VKImage > get_gpu_texture() const
Portal::Graphics::ImageFormat m_format
std::shared_ptr< Core::VKImage > get_texture() const
Get GPU texture image Suitable for binding to shaders via RenderProcessor::bind_texture()
std::vector< uint8_t > m_vertex_bytes
void set_texture_processor(const std::shared_ptr< TextureProcessor > &processor)
Allow inherited classes to set the TextureProcessor directly.
std::vector< uint8_t > & get_pixel_data_mutable()
std::shared_ptr< Core::VKImage > get_gpu_texture()
Get the GPU texture image.
A hybrid buffer managing both a textured quad geometry and its pixel data.
Internal processor: handles CPU→GPU transfers for TextureBuffer.
Vulkan-backed buffer wrapper used in processing chains.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
ImageFormat
User-friendly image format enum.