MayaFlux 0.3.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 29 of file TextureNode.cpp.

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

References a, b, m_height, m_pixel_buffer, m_pixel_data_dirty, and m_width.

Referenced by fill().

+ Here is the caller graph for this function: