MCPcopy Create free account
hub / github.com/blender/cycles / writePixels

Function writePixels

src/hydra/render_buffer.cpp:161–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160template<typename SrcT, typename DstT, typename Convertor = SimpleConversion>
161void writePixels(const SrcT *srcPtr,
162 const GfVec2i &srcSize,
163 const int srcChannelCount,
164 DstT *dstPtr,
165 const GfVec2i &dstSize,
166 const int dstChannelCount,
167 const Convertor &convertor = {})
168{
169 const auto writeSize = GfVec2i(GfMin(srcSize[0], dstSize[0]), GfMin(srcSize[1], dstSize[1]));
170 const auto writeChannelCount = GfMin(srcChannelCount, dstChannelCount);
171
172 for (int y = 0; y < writeSize[1]; ++y) {
173 for (int x = 0; x < writeSize[0]; ++x) {
174 for (int c = 0; c < writeChannelCount; ++c) {
175 dstPtr[x * dstChannelCount + c] = convertor.convert(srcPtr[x * srcChannelCount + c]);
176 }
177 }
178 srcPtr += srcSize[0] * srcChannelCount;
179 dstPtr += dstSize[0] * dstChannelCount;
180 }
181}
182
183} // namespace
184

Callers 1

WritePixelsMethod · 0.85

Calls 1

convertMethod · 0.45

Tested by

no test coverage detected