Blender  V3.3
fallback_impl.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2012 Blender Foundation. All rights reserved. */
3 
4 #include <algorithm>
5 #include <cstring>
6 #include <vector>
7 
8 #include "BLI_math_color.h"
9 #include "BLI_math_vector.h"
10 #include "MEM_guardedalloc.h"
11 
12 #include "ocio_impl.h"
13 
14 using std::max;
15 
16 #define CONFIG_DEFAULT ((OCIO_ConstConfigRcPtr *)1)
17 
24 };
25 
26 #define COLORSPACE_LINEAR ((OCIO_ConstColorSpaceRcPtr *)1)
27 #define COLORSPACE_SRGB ((OCIO_ConstColorSpaceRcPtr *)2)
28 
30  float *data;
31  long width;
32  long height;
38 
41  {
42  }
43 
45  {
46  }
47 
48  void applyRGB(float *pixel)
49  {
51  pixel[0] *= scale;
52  pixel[1] *= scale;
53  pixel[2] *= scale;
54 
55  linearrgb_to_srgb_v3_v3(pixel, pixel);
56 
57  pixel[0] = powf(max(0.0f, pixel[0]), exponent);
58  pixel[1] = powf(max(0.0f, pixel[1]), exponent);
59  pixel[2] = powf(max(0.0f, pixel[2]), exponent);
60  }
61  else if (type == TRANSFORM_SRGB_TO_LINEAR) {
62  srgb_to_linearrgb_v3_v3(pixel, pixel);
63  }
64  else if (type == TRANSFORM_EXPONENT) {
65  pixel[0] = powf(max(0.0f, pixel[0]), exponent);
66  pixel[1] = powf(max(0.0f, pixel[1]), exponent);
67  pixel[2] = powf(max(0.0f, pixel[2]), exponent);
68  }
69  else if (type == TRANSFORM_SCALE) {
70  pixel[0] *= scale;
71  pixel[1] *= scale;
72  pixel[2] *= scale;
73  }
74  }
75 
76  void applyRGBA(float *pixel)
77  {
78  applyRGB(pixel);
79  }
80 
82  /* Scale transform. */
83  float scale;
84  /* Exponent transform. */
85  float exponent;
86 
87  MEM_CXX_CLASS_ALLOC_FUNCS("FallbackTransform");
88 };
89 
92  {
93  }
94 
95  void applyRGB(float *pixel)
96  {
97  transform.applyRGB(pixel);
98  }
99 
100  void applyRGBA(float *pixel)
101  {
102  transform.applyRGBA(pixel);
103  }
104 
106 
107  MEM_CXX_CLASS_ALLOC_FUNCS("FallbackProcessor");
108 };
109 
110 OCIO_ConstConfigRcPtr *FallbackImpl::getCurrentConfig()
111 {
112  return CONFIG_DEFAULT;
113 }
114 
115 void FallbackImpl::setCurrentConfig(const OCIO_ConstConfigRcPtr * /*config*/)
116 {
117 }
118 
119 OCIO_ConstConfigRcPtr *FallbackImpl::configCreateFromEnv()
120 {
121  return NULL;
122 }
123 
124 OCIO_ConstConfigRcPtr *FallbackImpl::configCreateFromFile(const char * /*filename*/)
125 {
126  return CONFIG_DEFAULT;
127 }
128 
129 void FallbackImpl::configRelease(OCIO_ConstConfigRcPtr * /*config*/)
130 {
131 }
132 
133 int FallbackImpl::configGetNumColorSpaces(OCIO_ConstConfigRcPtr * /*config*/)
134 {
135  return 2;
136 }
137 
138 const char *FallbackImpl::configGetColorSpaceNameByIndex(OCIO_ConstConfigRcPtr * /*config*/,
139  int index)
140 {
141  if (index == 0)
142  return "Linear";
143  else if (index == 1)
144  return "sRGB";
145 
146  return NULL;
147 }
148 
149 OCIO_ConstColorSpaceRcPtr *FallbackImpl::configGetColorSpace(OCIO_ConstConfigRcPtr * /*config*/,
150  const char *name)
151 {
152  if (strcmp(name, "scene_linear") == 0)
153  return COLORSPACE_LINEAR;
154  else if (strcmp(name, "color_picking") == 0)
155  return COLORSPACE_SRGB;
156  else if (strcmp(name, "texture_paint") == 0)
157  return COLORSPACE_LINEAR;
158  else if (strcmp(name, "default_byte") == 0)
159  return COLORSPACE_SRGB;
160  else if (strcmp(name, "default_float") == 0)
161  return COLORSPACE_LINEAR;
162  else if (strcmp(name, "default_sequencer") == 0)
163  return COLORSPACE_SRGB;
164  else if (strcmp(name, "Linear") == 0)
165  return COLORSPACE_LINEAR;
166  else if (strcmp(name, "sRGB") == 0)
167  return COLORSPACE_SRGB;
168 
169  return NULL;
170 }
171 
172 int FallbackImpl::configGetIndexForColorSpace(OCIO_ConstConfigRcPtr *config, const char *name)
173 {
174  OCIO_ConstColorSpaceRcPtr *cs = configGetColorSpace(config, name);
175 
176  if (cs == COLORSPACE_LINEAR) {
177  return 0;
178  }
179  else if (cs == COLORSPACE_SRGB) {
180  return 1;
181  }
182  return -1;
183 }
184 
185 const char *FallbackImpl::configGetDefaultDisplay(OCIO_ConstConfigRcPtr * /*config*/)
186 {
187  return "sRGB";
188 }
189 
190 int FallbackImpl::configGetNumDisplays(OCIO_ConstConfigRcPtr * /*config*/)
191 {
192  return 1;
193 }
194 
195 const char *FallbackImpl::configGetDisplay(OCIO_ConstConfigRcPtr * /*config*/, int index)
196 {
197  if (index == 0) {
198  return "sRGB";
199  }
200  return NULL;
201 }
202 
203 const char *FallbackImpl::configGetDefaultView(OCIO_ConstConfigRcPtr * /*config*/,
204  const char * /*display*/)
205 {
206  return "Standard";
207 }
208 
209 int FallbackImpl::configGetNumViews(OCIO_ConstConfigRcPtr * /*config*/, const char * /*display*/)
210 {
211  return 1;
212 }
213 
214 const char *FallbackImpl::configGetView(OCIO_ConstConfigRcPtr * /*config*/,
215  const char * /*display*/,
216  int index)
217 {
218  if (index == 0) {
219  return "Standard";
220  }
221  return NULL;
222 }
223 
224 const char *FallbackImpl::configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr * /*config*/,
225  const char * /*display*/,
226  const char * /*view*/)
227 {
228  return "sRGB";
229 }
230 
231 void FallbackImpl::configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr * /*config*/, float *rgb)
232 {
233  /* Here we simply use the older Blender assumed primaries of
234  * ITU-BT.709 / sRGB, or 0.2126729 0.7151522 0.0721750. Brute
235  * force stupid, but only plausible option given no color management
236  * system in place.
237  */
238 
239  rgb[0] = 0.2126f;
240  rgb[1] = 0.7152f;
241  rgb[2] = 0.0722f;
242 }
243 
244 void FallbackImpl::configGetXYZtoSceneLinear(OCIO_ConstConfigRcPtr * /*config*/,
245  float xyz_to_scene_linear[3][3])
246 {
247  /* Default to ITU-BT.709. */
248  memcpy(xyz_to_scene_linear, OCIO_XYZ_TO_REC709, sizeof(OCIO_XYZ_TO_REC709));
249 }
250 
251 int FallbackImpl::configGetNumLooks(OCIO_ConstConfigRcPtr * /*config*/)
252 {
253  return 0;
254 }
255 
256 const char *FallbackImpl::configGetLookNameByIndex(OCIO_ConstConfigRcPtr * /*config*/,
257  int /*index*/)
258 {
259  return "";
260 }
261 
262 OCIO_ConstLookRcPtr *FallbackImpl::configGetLook(OCIO_ConstConfigRcPtr * /*config*/,
263  const char * /*name*/)
264 {
265  return NULL;
266 }
267 
268 const char *FallbackImpl::lookGetProcessSpace(OCIO_ConstLookRcPtr * /*look*/)
269 {
270  return NULL;
271 }
272 
273 void FallbackImpl::lookRelease(OCIO_ConstLookRcPtr * /*look*/)
274 {
275 }
276 
277 int FallbackImpl::colorSpaceIsInvertible(OCIO_ConstColorSpaceRcPtr * /*cs*/)
278 {
279  return 1;
280 }
281 
282 int FallbackImpl::colorSpaceIsData(OCIO_ConstColorSpaceRcPtr * /*cs*/)
283 {
284  return 0;
285 }
286 
287 void FallbackImpl::colorSpaceIsBuiltin(OCIO_ConstConfigRcPtr * /*config*/,
288  OCIO_ConstColorSpaceRcPtr *cs,
289  bool &is_scene_linear,
290  bool &is_srgb)
291 {
292  if (cs == COLORSPACE_LINEAR) {
293  is_scene_linear = true;
294  is_srgb = false;
295  }
296  else if (cs == COLORSPACE_SRGB) {
297  is_scene_linear = false;
298  is_srgb = true;
299  }
300  else {
301  is_scene_linear = false;
302  is_srgb = false;
303  }
304 }
305 
306 void FallbackImpl::colorSpaceRelease(OCIO_ConstColorSpaceRcPtr * /*cs*/)
307 {
308 }
309 
310 OCIO_ConstProcessorRcPtr *FallbackImpl::configGetProcessorWithNames(OCIO_ConstConfigRcPtr *config,
311  const char *srcName,
312  const char *dstName)
313 {
314  OCIO_ConstColorSpaceRcPtr *cs_src = configGetColorSpace(config, srcName);
315  OCIO_ConstColorSpaceRcPtr *cs_dst = configGetColorSpace(config, dstName);
317  if (cs_src == COLORSPACE_LINEAR && cs_dst == COLORSPACE_SRGB) {
319  }
320  else if (cs_src == COLORSPACE_SRGB && cs_dst == COLORSPACE_LINEAR) {
322  }
323  else {
325  }
326  return (OCIO_ConstProcessorRcPtr *)new FallbackProcessor(transform);
327 }
328 
329 OCIO_ConstCPUProcessorRcPtr *FallbackImpl::processorGetCPUProcessor(
330  OCIO_ConstProcessorRcPtr *processor)
331 {
332  /* Just make a copy of the processor so that we are compatible with OCIO
333  * which does need it as a separate object. */
334  FallbackProcessor *fallback_processor = (FallbackProcessor *)processor;
335  return (OCIO_ConstCPUProcessorRcPtr *)new FallbackProcessor(*fallback_processor);
336 }
337 
338 void FallbackImpl::processorRelease(OCIO_ConstProcessorRcPtr *processor)
339 {
340  delete (FallbackProcessor *)(processor);
341 }
342 
343 void FallbackImpl::cpuProcessorApply(OCIO_ConstCPUProcessorRcPtr *cpu_processor,
344  OCIO_PackedImageDesc *img)
345 {
346  /* OCIO_TODO stride not respected, channels must be 3 or 4 */
348  int channels = desc->numChannels;
349  float *pixels = desc->data;
350  int width = desc->width;
351  int height = desc->height;
352  int x, y;
353 
354  for (y = 0; y < height; y++) {
355  for (x = 0; x < width; x++) {
356  float *pixel = pixels + channels * (y * width + x);
357 
358  if (channels == 4)
359  cpuProcessorApplyRGBA(cpu_processor, pixel);
360  else if (channels == 3)
361  cpuProcessorApplyRGB(cpu_processor, pixel);
362  }
363  }
364 }
365 
366 void FallbackImpl::cpuProcessorApply_predivide(OCIO_ConstCPUProcessorRcPtr *cpu_processor,
367  OCIO_PackedImageDesc *img)
368 {
369  /* OCIO_TODO stride not respected, channels must be 3 or 4 */
371  int channels = desc->numChannels;
372  float *pixels = desc->data;
373  int width = desc->width;
374  int height = desc->height;
375  int x, y;
376 
377  for (y = 0; y < height; y++) {
378  for (x = 0; x < width; x++) {
379  float *pixel = pixels + channels * (y * width + x);
380 
381  if (channels == 4)
382  cpuProcessorApplyRGBA_predivide(cpu_processor, pixel);
383  else if (channels == 3)
384  cpuProcessorApplyRGB(cpu_processor, pixel);
385  }
386  }
387 }
388 
389 void FallbackImpl::cpuProcessorApplyRGB(OCIO_ConstCPUProcessorRcPtr *cpu_processor, float *pixel)
390 {
391  ((FallbackProcessor *)cpu_processor)->applyRGB(pixel);
392 }
393 
394 void FallbackImpl::cpuProcessorApplyRGBA(OCIO_ConstCPUProcessorRcPtr *cpu_processor, float *pixel)
395 {
396  ((FallbackProcessor *)cpu_processor)->applyRGBA(pixel);
397 }
398 
399 void FallbackImpl::cpuProcessorApplyRGBA_predivide(OCIO_ConstCPUProcessorRcPtr *cpu_processor,
400  float *pixel)
401 {
402  if (pixel[3] == 1.0f || pixel[3] == 0.0f) {
403  cpuProcessorApplyRGBA(cpu_processor, pixel);
404  }
405  else {
406  float alpha, inv_alpha;
407 
408  alpha = pixel[3];
409  inv_alpha = 1.0f / alpha;
410 
411  pixel[0] *= inv_alpha;
412  pixel[1] *= inv_alpha;
413  pixel[2] *= inv_alpha;
414 
415  cpuProcessorApplyRGBA(cpu_processor, pixel);
416 
417  pixel[0] *= alpha;
418  pixel[1] *= alpha;
419  pixel[2] *= alpha;
420  }
421 }
422 
423 void FallbackImpl::cpuProcessorRelease(OCIO_ConstCPUProcessorRcPtr *cpu_processor)
424 {
425  delete (FallbackProcessor *)(cpu_processor);
426 }
427 
428 const char *FallbackImpl::colorSpaceGetName(OCIO_ConstColorSpaceRcPtr *cs)
429 {
430  if (cs == COLORSPACE_LINEAR) {
431  return "Linear";
432  }
433  else if (cs == COLORSPACE_SRGB) {
434  return "sRGB";
435  }
436  return NULL;
437 }
438 
439 const char *FallbackImpl::colorSpaceGetDescription(OCIO_ConstColorSpaceRcPtr * /*cs*/)
440 {
441  return "";
442 }
443 
444 const char *FallbackImpl::colorSpaceGetFamily(OCIO_ConstColorSpaceRcPtr * /*cs*/)
445 {
446  return "";
447 }
448 
449 int FallbackImpl::colorSpaceGetNumAliases(OCIO_ConstColorSpaceRcPtr * /*cs*/)
450 {
451  return 0;
452 }
453 const char *FallbackImpl::colorSpaceGetAlias(OCIO_ConstColorSpaceRcPtr * /*cs*/,
454  const int /*index*/)
455 {
456  return "";
457 }
458 
459 OCIO_ConstProcessorRcPtr *FallbackImpl::createDisplayProcessor(OCIO_ConstConfigRcPtr * /*config*/,
460  const char * /*input*/,
461  const char * /*view*/,
462  const char * /*display*/,
463  const char * /*look*/,
464  const float scale,
465  const float exponent,
466  const bool inverse)
467 {
470  transform.scale = (inverse && scale != 0.0f) ? 1.0f / scale : scale;
471  transform.exponent = (inverse && exponent != 0.0f) ? 1.0f / exponent : exponent;
472 
473  return (OCIO_ConstProcessorRcPtr *)new FallbackProcessor(transform);
474 }
475 
476 OCIO_PackedImageDesc *FallbackImpl::createOCIO_PackedImageDesc(float *data,
477  long width,
478  long height,
479  long numChannels,
480  long chanStrideBytes,
481  long xStrideBytes,
482  long yStrideBytes)
483 {
484  OCIO_PackedImageDescription *desc = MEM_cnew<OCIO_PackedImageDescription>(
485  "OCIO_PackedImageDescription");
486  desc->data = data;
487  desc->width = width;
488  desc->height = height;
489  desc->numChannels = numChannels;
490  desc->chanStrideBytes = chanStrideBytes;
491  desc->xStrideBytes = xStrideBytes;
492  desc->yStrideBytes = yStrideBytes;
493  return (OCIO_PackedImageDesc *)desc;
494 }
495 
496 void FallbackImpl::OCIO_PackedImageDescRelease(OCIO_PackedImageDesc *id)
497 {
498  MEM_freeN(id);
499 }
500 
502 {
503  return "fallback";
504 }
505 
507 {
508  return 0;
509 }
MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
MINLINE void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
btMatrix3x3 inverse() const
Return the inverse of the matrix.
Definition: btTransform.h:182
const char * colorSpaceGetFamily(OCIO_ConstColorSpaceRcPtr *cs)
int configGetNumDisplays(OCIO_ConstConfigRcPtr *config)
const char * configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index)
int configGetIndexForColorSpace(OCIO_ConstConfigRcPtr *config, const char *name)
const char * configGetDefaultDisplay(OCIO_ConstConfigRcPtr *config)
void colorSpaceRelease(OCIO_ConstColorSpaceRcPtr *cs)
const char * configGetDisplay(OCIO_ConstConfigRcPtr *config, int index)
void configGetXYZtoSceneLinear(OCIO_ConstConfigRcPtr *config, float xyz_to_scene_linear[3][3])
void configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb)
int colorSpaceIsData(OCIO_ConstColorSpaceRcPtr *cs)
int colorSpaceGetNumAliases(OCIO_ConstColorSpaceRcPtr *cs)
const char * getVersionString(void)
void processorRelease(OCIO_ConstProcessorRcPtr *processor)
void setCurrentConfig(const OCIO_ConstConfigRcPtr *config)
int getVersionHex(void)
OCIO_PackedImageDesc * createOCIO_PackedImageDesc(float *data, long width, long height, long numChannels, long chanStrideBytes, long xStrideBytes, long yStrideBytes)
OCIO_ConstConfigRcPtr * configCreateFromEnv(void)
OCIO_ConstConfigRcPtr * getCurrentConfig(void)
const char * configGetDefaultView(OCIO_ConstConfigRcPtr *config, const char *display)
void configRelease(OCIO_ConstConfigRcPtr *config)
void lookRelease(OCIO_ConstLookRcPtr *look)
OCIO_ConstColorSpaceRcPtr * configGetColorSpace(OCIO_ConstConfigRcPtr *config, const char *name)
const char * colorSpaceGetName(OCIO_ConstColorSpaceRcPtr *cs)
const char * configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view)
void OCIO_PackedImageDescRelease(OCIO_PackedImageDesc *p)
OCIO_ConstProcessorRcPtr * createDisplayProcessor(OCIO_ConstConfigRcPtr *config, const char *input, const char *view, const char *display, const char *look, const float scale, const float exponent, const bool inverse)
void cpuProcessorApply_predivide(OCIO_ConstCPUProcessorRcPtr *cpu_processor, OCIO_PackedImageDesc *img)
void cpuProcessorRelease(OCIO_ConstCPUProcessorRcPtr *cpu_processor)
const char * colorSpaceGetAlias(OCIO_ConstColorSpaceRcPtr *cs, const int index)
int colorSpaceIsInvertible(OCIO_ConstColorSpaceRcPtr *cs)
const char * colorSpaceGetDescription(OCIO_ConstColorSpaceRcPtr *cs)
void cpuProcessorApplyRGBA_predivide(OCIO_ConstCPUProcessorRcPtr *cpu_processor, float *pixel)
void cpuProcessorApplyRGB(OCIO_ConstCPUProcessorRcPtr *cpu_processor, float *pixel)
void cpuProcessorApply(OCIO_ConstCPUProcessorRcPtr *cpu_processor, OCIO_PackedImageDesc *img)
const char * lookGetProcessSpace(OCIO_ConstLookRcPtr *look)
void colorSpaceIsBuiltin(OCIO_ConstConfigRcPtr *config, OCIO_ConstColorSpaceRcPtr *cs, bool &is_scene_linear, bool &is_srgb)
int configGetNumLooks(OCIO_ConstConfigRcPtr *config)
OCIO_ConstConfigRcPtr * configCreateFromFile(const char *filename)
const char * configGetLookNameByIndex(OCIO_ConstConfigRcPtr *config, int index)
void cpuProcessorApplyRGBA(OCIO_ConstCPUProcessorRcPtr *cpu_processor, float *pixel)
OCIO_ConstCPUProcessorRcPtr * processorGetCPUProcessor(OCIO_ConstProcessorRcPtr *processor)
OCIO_ConstProcessorRcPtr * configGetProcessorWithNames(OCIO_ConstConfigRcPtr *config, const char *srcName, const char *dstName)
int configGetNumViews(OCIO_ConstConfigRcPtr *config, const char *display)
OCIO_ConstLookRcPtr * configGetLook(OCIO_ConstConfigRcPtr *config, const char *name)
int configGetNumColorSpaces(OCIO_ConstConfigRcPtr *config)
const char * configGetColorSpaceNameByIndex(OCIO_ConstConfigRcPtr *config, int index)
#define powf(x, y)
Definition: cuda/compat.h:103
#define COLORSPACE_LINEAR
#define CONFIG_DEFAULT
TransformType
@ TRANSFORM_UNKNOWN
@ TRANSFORM_SRGB_TO_LINEAR
@ TRANSFORM_SCALE
@ TRANSFORM_LINEAR_TO_SRGB
@ TRANSFORM_EXPONENT
struct OCIO_PackedImageDescription OCIO_PackedImageDescription
#define COLORSPACE_SRGB
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
static const pxr::TfToken rgb("rgb", pxr::TfToken::Immortal)
static const float OCIO_XYZ_TO_REC709[3][3]
Definition: ocio_capi.h:35
MEM_CXX_CLASS_ALLOC_FUNCS("FallbackProcessor")
FallbackTransform transform
void applyRGB(float *pixel)
void applyRGBA(float *pixel)
FallbackProcessor(const FallbackTransform &transform)
virtual ~FallbackTransform()
void applyRGBA(float *pixel)
MEM_CXX_CLASS_ALLOC_FUNCS("FallbackTransform")
void applyRGB(float *pixel)
TransformType type
float max