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 127 of file EXRWriter.cpp.

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

References width.

Referenced by write().

+ Here is the caller graph for this function: