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}
References width.
Referenced by write().