17#define CONFIG_DEFAULT ((OCIO_ConstConfigRcPtr *)1)
28#define COLORSPACE_LINEAR ((OCIO_ConstColorSpaceRcPtr *)1)
29#define COLORSPACE_SRGB ((OCIO_ConstColorSpaceRcPtr *)2)
30#define COLORSPACE_DATA ((OCIO_ConstColorSpaceRcPtr *)3)
100 transform.applyRGB(pixel);
105 transform.applyRGBA(pixel);
110 return transform.isNoOp();
148 else if (index == 1) {
158 if (strcmp(name,
"scene_linear") == 0) {
161 else if (strcmp(name,
"color_picking") == 0) {
164 else if (strcmp(name,
"texture_paint") == 0) {
167 else if (strcmp(name,
"default_byte") == 0) {
170 else if (strcmp(name,
"default_float") == 0) {
173 else if (strcmp(name,
"default_sequencer") == 0) {
176 else if (strcmp(name,
"Linear") == 0) {
179 else if (strcmp(name,
"sRGB") == 0) {
182 else if (strcmp(name,
"data") == 0) {
265 float xyz_to_scene_linear[3][3])
306 OCIO_ConstColorSpaceRcPtr *cs,
307 bool &is_scene_linear,
311 is_scene_linear =
true;
315 is_scene_linear =
false;
319 is_scene_linear =
false;
349 OCIO_ConstProcessorRcPtr *processor)
368 OCIO_PackedImageDesc *img)
373 float *pixels = desc->
data;
374 int width = desc->
width;
375 int height = desc->
height;
378 for (y = 0; y < height; y++) {
379 for (x = 0; x < width; x++) {
380 float *pixel = pixels + channels * (y * width +
x);
385 else if (channels == 3) {
393 OCIO_PackedImageDesc *img)
398 float *pixels = desc->
data;
399 int width = desc->
width;
400 int height = desc->
height;
403 for (y = 0; y < height; y++) {
404 for (x = 0; x < width; x++) {
405 float *pixel = pixels + channels * (y * width +
x);
410 else if (channels == 3) {
430 if (pixel[3] == 1.0f || pixel[3] == 0.0f) {
434 float alpha, inv_alpha;
437 inv_alpha = 1.0f / alpha;
439 pixel[0] *= inv_alpha;
440 pixel[1] *= inv_alpha;
441 pixel[2] *= inv_alpha;
496 const float exponent,
504 transform.scale = (
inverse && scale != 0.0f) ? 1.0f / scale : scale;
505 transform.exponent = (
inverse && exponent != 0.0f) ? 1.0f / exponent : exponent;
514 long chanStrideBytes,
519 "OCIO_PackedImageDescription");
527 return (OCIO_PackedImageDesc *)desc;
void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
struct OCIO_ConstCPUProcessorRc * OCIO_ConstCPUProcessorRcPtr
Read Guarded memory(de)allocation.
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
btMatrix3x3 inverse() const
Return the inverse of the matrix.
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)
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 float temperature, const float tint, const bool use_white_balance, const bool inverse)
void processorRelease(OCIO_ConstProcessorRcPtr *processor)
void setCurrentConfig(const OCIO_ConstConfigRcPtr *config)
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)
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)
bool cpuProcessorIsNoOp(OCIO_ConstCPUProcessorRcPtr *cpu_processor)
#define COLORSPACE_LINEAR
@ TRANSFORM_SRGB_TO_LINEAR
@ TRANSFORM_LINEAR_TO_SRGB
void MEM_freeN(void *vmemh)
static const float OCIO_XYZ_TO_REC709[3][3]
MEM_CXX_CLASS_ALLOC_FUNCS("FallbackProcessor")
FallbackTransform transform
void applyRGB(float *pixel)
void applyRGBA(float *pixel)
FallbackProcessor(const FallbackTransform &transform)