52 bool m_pixel_data_dirty {
true };
61 [[nodiscard]] std::span<const float>
get_pixel_buffer()
const {
return m_pixel_buffer; }
63 [[nodiscard]] uint32_t
get_width()
const {
return m_width; }
64 [[nodiscard]] uint32_t
get_height()
const {
return m_height; }
72 return static_cast<size_t>(m_width) *
static_cast<size_t>(m_height);
81 return m_pixel_buffer.size() *
sizeof(float);
93 return m_pixel_data_dirty;
104 m_pixel_data_dirty =
false;
110 void save_state()
override;
115 void restore_state()
override;
131 void update_context(
double value)
override;
143 void set_pixel(uint32_t x, uint32_t y,
float r,
float g,
float b,
float a = 1.0F);
151 [[nodiscard]] std::array<float, 4> get_pixel(uint32_t x, uint32_t y)
const;
160 void fill(
float r,
float g,
float b,
float a = 1.0F);
168 bool m_saved_dirty_flag {};
180 return m_pixel_buffer;
TextureContext(double value, uint32_t width, uint32_t height, std::span< const float > pixel_data)
Context for TextureNode - provides pixel buffer access.
void clear_gpu_update_flag() override
Clear the dirty flag after GPU upload completes.
std::span< float > get_pixel_buffer_mutable()
Get mutable pixel buffer for direct write access.
uint32_t get_height() const
std::vector< float > m_saved_pixel_buffer
std::span< const float > get_pixel_buffer() const
Get pixel buffer.
std::vector< float > m_pixel_buffer
bool needs_gpu_update() const override
Check if pixel data changed since last GPU sync.
size_t get_pixel_count() const
Get total number of pixels.
uint32_t get_width() const
size_t get_buffer_size() const
Get buffer size in bytes.
Base class for texture-generating nodes.
Base context class for node callbacks.