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

Function EvalTransform

src/OpenColorIO/ops/OpTools.cpp:11–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace OCIO_NAMESPACE
10{
11void EvalTransform(const float * in,
12 float * out,
13 long numPixels,
14 OpRcPtrVec & ops)
15{
16 std::vector<float> tmp(numPixels * 4);
17
18 // Render the LUT entries (domain) through the ops.
19 const float * values = in;
20 for (long idx = 0; idx<numPixels; ++idx)
21 {
22 tmp[4 * idx + 0] = values[0];
23 tmp[4 * idx + 1] = values[1];
24 tmp[4 * idx + 2] = values[2];
25 tmp[4 * idx + 3] = 1.0f;
26
27 values += 3;
28 }
29
30 ops.finalize();
31 ops.optimize(OPTIMIZATION_NONE);
32
33 for (OpRcPtrVec::size_type i = 0, size = ops.size(); i<size; ++i)
34 {
35 ops[i]->apply(&tmp[0], &tmp[0], numPixels);
36 }
37
38 float * result = out;
39 for (long idx = 0; idx<numPixels; ++idx)
40 {
41 result[0] = tmp[4 * idx + 0];
42 result[1] = tmp[4 * idx + 1];
43 result[2] = tmp[4 * idx + 2];
44
45 result += 3;
46 }
47}
48} // namespace OCIO_NAMESPACE

Callers 2

ComposeMethod · 0.85
ComposeVecMethod · 0.85

Calls 4

optimizeMethod · 0.80
finalizeMethod · 0.45
sizeMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected