MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_pixel()

void MayaFlux::Nodes::GpuSync::TextureNode::set_pixel ( uint32_t  x,
uint32_t  y,
float  r,
float  g,
float  b,
float  a = 1.0F 
)
protected

Set pixel color at (x, y)

Parameters
xX coordinate
yY coordinate
rRed channel [0, 1]
gGreen channel [0, 1]
bBlue channel [0, 1]
aAlpha channel [0, 1] (default: 1.0)

Definition at line 27 of file TextureNode.cpp.

28{
29 if (x >= m_width || y >= m_height) {
30 return;
31 }
32
33 size_t idx = (static_cast<size_t>(y) * m_width + x) * 4;
34 m_pixel_buffer[idx + 0] = r;
35 m_pixel_buffer[idx + 1] = g;
36 m_pixel_buffer[idx + 2] = b;
37 m_pixel_buffer[idx + 3] = a;
38
39 m_pixel_data_dirty = true;
40}
bool m_pixel_data_dirty
Flag: pixel data changed since last GPU upload.

References m_height, m_pixel_buffer, m_pixel_data_dirty, and m_width.

Referenced by fill().

+ Here is the caller graph for this function: