2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* The Original Code is Copyright (C) 2012 Blender Foundation.
19
* All rights reserved.
21
* Contributor(s): Xavier Thomas
25
* ***** END GPL LICENSE BLOCK *****
28
#ifndef __OCIO_CAPI_H__
29
#define __OCIO_CAPI_H__
35
#define OCIO_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
37
#define OCIO_ROLE_SCENE_LINEAR "scene_linear"
38
#define OCIO_ROLE_COLOR_PICKING "color_picking"
39
#define OCIO_ROLE_TEXTURE_PAINT "texture_paint"
40
#define OCIO_ROLE_DEFAULT_BYTE "default_byte"
41
#define OCIO_ROLE_DEFAULT_FLOAT "default_float"
42
#define OCIO_ROLE_DEFAULT_SEQUENCER "default_sequencer"
44
OCIO_DECLARE_HANDLE(OCIO_ConstConfigRcPtr);
45
OCIO_DECLARE_HANDLE(OCIO_ConstColorSpaceRcPtr);
46
OCIO_DECLARE_HANDLE(OCIO_ConstProcessorRcPtr);
47
OCIO_DECLARE_HANDLE(OCIO_ConstContextRcPtr);
48
OCIO_DECLARE_HANDLE(OCIO_PackedImageDesc);
49
OCIO_DECLARE_HANDLE(OCIO_DisplayTransformRcPtr);
50
OCIO_DECLARE_HANDLE(OCIO_ConstTransformRcPtr);
51
OCIO_DECLARE_HANDLE(OCIO_ExponentTransformRcPtr);
52
OCIO_DECLARE_HANDLE(OCIO_MatrixTransformRcPtr);
57
OCIO_ConstConfigRcPtr *OCIO_getCurrentConfig(void);
58
void OCIO_setCurrentConfig(const OCIO_ConstConfigRcPtr *config);
60
OCIO_ConstConfigRcPtr *OCIO_configCreateFromEnv(void);
61
OCIO_ConstConfigRcPtr *OCIO_configCreateFromFile(const char* filename);
62
OCIO_ConstConfigRcPtr *OCIO_configCreateFallback(void);
64
void OCIO_configRelease(OCIO_ConstConfigRcPtr *config);
66
int OCIO_configGetNumColorSpaces(OCIO_ConstConfigRcPtr *config);
67
const char *OCIO_configGetColorSpaceNameByIndex(OCIO_ConstConfigRcPtr *config, int index);
68
OCIO_ConstColorSpaceRcPtr *OCIO_configGetColorSpace(OCIO_ConstConfigRcPtr *config, const char *name);
69
int OCIO_configGetIndexForColorSpace(OCIO_ConstConfigRcPtr *config, const char *name);
71
int OCIO_colorSpaceIsInvertible(OCIO_ConstColorSpaceRcPtr *cs);
72
int OCIO_colorSpaceIsData(OCIO_ConstColorSpaceRcPtr *cs);
74
void OCIO_colorSpaceRelease(OCIO_ConstColorSpaceRcPtr *cs);
76
const char *OCIO_configGetDefaultDisplay(OCIO_ConstConfigRcPtr *config);
77
int OCIO_configGetNumDisplays(OCIO_ConstConfigRcPtr *config);
78
const char *OCIO_configGetDisplay(OCIO_ConstConfigRcPtr *config, int index);
79
const char *OCIO_configGetDefaultView(OCIO_ConstConfigRcPtr *config, const char *display);
80
int OCIO_configGetNumViews(OCIO_ConstConfigRcPtr *config, const char *display);
81
const char *OCIO_configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index);
82
const char *OCIO_configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view);
84
OCIO_ConstProcessorRcPtr *OCIO_configGetProcessorWithNames(OCIO_ConstConfigRcPtr *config, const char *srcName, const char *dstName);
85
OCIO_ConstProcessorRcPtr *OCIO_configGetProcessor(OCIO_ConstConfigRcPtr *config, OCIO_ConstTransformRcPtr *transform);
87
void OCIO_processorApply(OCIO_ConstProcessorRcPtr *processor, OCIO_PackedImageDesc *img);
88
void OCIO_processorApply_predivide(OCIO_ConstProcessorRcPtr *processor, OCIO_PackedImageDesc *img);
89
void OCIO_processorApplyRGB(OCIO_ConstProcessorRcPtr *processor, float *pixel);
90
void OCIO_processorApplyRGBA(OCIO_ConstProcessorRcPtr *processor, float *pixel);
91
void OCIO_processorApplyRGBA_predivide(OCIO_ConstProcessorRcPtr *processor, float *pixel);
93
void OCIO_processorRelease(OCIO_ConstProcessorRcPtr *p);
95
const char *OCIO_colorSpaceGetName(OCIO_ConstColorSpaceRcPtr *cs);
96
const char *OCIO_colorSpaceGetDescription(OCIO_ConstColorSpaceRcPtr *cs);
97
const char *OCIO_colorSpaceGetFamily(OCIO_ConstColorSpaceRcPtr *cs);
99
OCIO_DisplayTransformRcPtr *OCIO_createDisplayTransform(void);
100
void OCIO_displayTransformSetInputColorSpaceName(OCIO_DisplayTransformRcPtr *dt, const char *name);
101
void OCIO_displayTransformSetDisplay(OCIO_DisplayTransformRcPtr *dt, const char *name);
102
void OCIO_displayTransformSetView(OCIO_DisplayTransformRcPtr *dt, const char *name);
103
void OCIO_displayTransformSetDisplayCC(OCIO_DisplayTransformRcPtr *dt, OCIO_ConstTransformRcPtr *et);
104
void OCIO_displayTransformSetLinearCC(OCIO_DisplayTransformRcPtr *dt, OCIO_ConstTransformRcPtr *et);
105
void OCIO_displayTransformRelease(OCIO_DisplayTransformRcPtr *dt);
107
OCIO_PackedImageDesc *OCIO_createOCIO_PackedImageDesc(float *data, long width, long height, long numChannels,
108
long chanStrideBytes, long xStrideBytes, long yStrideBytes);
110
void OCIO_PackedImageDescRelease(OCIO_PackedImageDesc *p);
112
OCIO_ExponentTransformRcPtr *OCIO_createExponentTransform(void);
113
void OCIO_exponentTransformSetValue(OCIO_ExponentTransformRcPtr *et, const float *exponent);
114
void OCIO_exponentTransformRelease(OCIO_ExponentTransformRcPtr *et);
116
OCIO_MatrixTransformRcPtr *OCIO_createMatrixTransform(void);
117
void OCIO_matrixTransformSetValue(OCIO_MatrixTransformRcPtr *et, const float *m44, const float *offset4);
118
void OCIO_matrixTransformRelease(OCIO_MatrixTransformRcPtr *mt);
120
void OCIO_matrixTransformScale(float * m44, float * offset4, const float * scale4);
126
#endif /* OCIO_CAPI_H */