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

Function GetLutImageSize

src/apps/ociolutimage/main.cpp:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29void GetLutImageSize(int & width, int & height,
30 int cubesize, int maxwidth)
31{
32 // Compute the image width / height
33 width = cubesize*cubesize;
34 if (maxwidth>0 && width>=maxwidth)
35 {
36 // TODO: Do something smarter here to find a better multiple,
37 // to create a more pleasing gradient rendition.
38 // Use prime divisors / lowest common denominator, if possible?
39 width = std::min(maxwidth, width);
40 }
41
42 int numpixels = cubesize*cubesize*cubesize;
43 height = (int)(ceilf((float)numpixels/(float)width));
44}
45
46
47void Generate(int cubesize, int maxwidth,

Callers 2

GenerateFunction · 0.85
ExtractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected