Process the complete image pixel per pixel.
| 141 | |
| 142 | // Process the complete image pixel per pixel. |
| 143 | void 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 | |
| 170 | int main(int argc, const char **argv) |
| 171 | { |
no test coverage detected