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

◆ deinterleave()

std::vector< std::vector< float > > MayaFlux::IO::EXRWriter::deinterleave ( const std::vector< float > &  src,
uint32_t  width,
uint32_t  height,
uint32_t  channels,
bool  flip_vertically 
)
staticprivate

Deinterleave source float buffer into N planar channel buffers.

Source layout: pixel-interleaved (P0C0 P0C1 P0C2 P0C3 P1C0 P1C1 ...). Output layout: one vector<float> per channel, scanline order. If flip_vertically is true, rows are emitted bottom-up.

Definition at line 130 of file EXRWriter.cpp.

134{
135 const size_t pixel_count = static_cast<size_t>(width) * height;
136 std::vector<std::vector<float>> planes(channels, std::vector<float>(pixel_count));
137
138 for (uint32_t y = 0; y < height; ++y) {
139 const uint32_t src_row = flip_vertically ? (height - 1 - y) : y;
140 const size_t src_row_offset = static_cast<size_t>(src_row) * width * channels;
141 const size_t dst_row_offset = static_cast<size_t>(y) * width;
142
143 for (uint32_t x = 0; x < width; ++x) {
144 const size_t src_pixel = src_row_offset + static_cast<size_t>(x) * channels;
145 const size_t dst_pixel = dst_row_offset + x;
146
147 for (uint32_t c = 0; c < channels; ++c) {
148 planes[c][dst_pixel] = src[src_pixel + c];
149 }
150 }
151 }
152
153 return planes;
154}
uint32_t width
Definition Decoder.cpp:59

References width.

Referenced by write().

+ Here is the caller graph for this function: