MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / ProcessPixels

Function ProcessPixels

src/apps/ocioperf/main.cpp:143–168  ·  view source on GitHub ↗

Process the complete image pixel per pixel.

Source from the content-addressed store, hash-verified

141
142// Process the complete image pixel per pixel.
143void ProcessPixels(CustomMeasure & m,
144 OCIO::ConstCPUProcessorRcPtr & cpuProcessor,
145 const OCIO::PackedImageDesc & img)
146{
147 // Always process the same complete image.
148 char * lineToProcess = reinterpret_cast<char *>(img.getData());
149
150 m.resume();
151
152 for(int h=0; h<img.getHeight(); ++h)
153 {
154 char * pixelToProcess = lineToProcess;
155 for(int w=0; w<img.getWidth(); ++w)
156 {
157 cpuProcessor->applyRGBA(reinterpret_cast<float*>(pixelToProcess));
158
159 // Find the next pixel.
160 pixelToProcess += img.getXStrideBytes();
161 }
162
163 // Find the next line.
164 lineToProcess += img.getYStrideBytes();
165 }
166
167 m.pause();
168}
169
170int main(int argc, const char **argv)
171{

Callers 1

mainFunction · 0.85

Calls 8

getDataMethod · 0.45
resumeMethod · 0.45
getHeightMethod · 0.45
getWidthMethod · 0.45
applyRGBAMethod · 0.45
getXStrideBytesMethod · 0.45
getYStrideBytesMethod · 0.45
pauseMethod · 0.45

Tested by

no test coverage detected