~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to intern/opencolorio/ocio_capi.cc

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ***** BEGIN GPL LICENSE BLOCK *****
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 *
 
18
 * The Original Code is Copyright (C) 2012 Blender Foundation.
 
19
 * All rights reserved.
 
20
 *
 
21
 * Contributor(s): Sergey Sharybin
 
22
 *
 
23
 * ***** END GPL LICENSE BLOCK *****
 
24
 */
 
25
 
 
26
#include "MEM_guardedalloc.h"
 
27
 
 
28
#include "ocio_impl.h"
 
29
 
 
30
static IOCIOImpl *impl = NULL;
 
31
 
 
32
void OCIO_init(void)
 
33
{
 
34
#ifdef WITH_OCIO
 
35
        impl = new OCIOImpl();
 
36
#else
 
37
        impl = new FallbackImpl();
 
38
#endif
 
39
}
 
40
 
 
41
void OCIO_exit(void)
 
42
{
 
43
        delete impl;
 
44
        impl = NULL;
 
45
}
 
46
 
 
47
OCIO_ConstConfigRcPtr *OCIO_getCurrentConfig(void)
 
48
{
 
49
        return impl->getCurrentConfig();
 
50
}
 
51
 
 
52
OCIO_ConstConfigRcPtr *OCIO_configCreateFallback(void)
 
53
{
 
54
        delete impl;
 
55
        impl = new FallbackImpl();
 
56
 
 
57
        return impl->getCurrentConfig();
 
58
}
 
59
 
 
60
void OCIO_setCurrentConfig(const OCIO_ConstConfigRcPtr *config)
 
61
{
 
62
        impl->setCurrentConfig(config);
 
63
}
 
64
 
 
65
OCIO_ConstConfigRcPtr *OCIO_configCreateFromEnv(void)
 
66
{
 
67
        return impl->configCreateFromEnv();
 
68
}
 
69
 
 
70
OCIO_ConstConfigRcPtr *OCIO_configCreateFromFile(const char *filename)
 
71
{
 
72
        return impl->configCreateFromFile(filename);
 
73
}
 
74
 
 
75
void OCIO_configRelease(OCIO_ConstConfigRcPtr *config)
 
76
{
 
77
        impl->configRelease(config);
 
78
}
 
79
 
 
80
int OCIO_configGetNumColorSpaces(OCIO_ConstConfigRcPtr *config)
 
81
{
 
82
        return impl->configGetNumColorSpaces(config);
 
83
}
 
84
 
 
85
const char *OCIO_configGetColorSpaceNameByIndex(OCIO_ConstConfigRcPtr *config, int index)
 
86
{
 
87
        return impl->configGetColorSpaceNameByIndex(config, index);
 
88
}
 
89
 
 
90
OCIO_ConstColorSpaceRcPtr *OCIO_configGetColorSpace(OCIO_ConstConfigRcPtr *config, const char *name)
 
91
{
 
92
        return impl->configGetColorSpace(config, name);
 
93
}
 
94
 
 
95
int OCIO_configGetIndexForColorSpace(OCIO_ConstConfigRcPtr *config, const char *name)
 
96
{
 
97
        return impl->configGetIndexForColorSpace(config, name);
 
98
}
 
99
 
 
100
const char *OCIO_configGetDefaultDisplay(OCIO_ConstConfigRcPtr *config)
 
101
{
 
102
        return impl->configGetDefaultDisplay(config);
 
103
}
 
104
 
 
105
int OCIO_configGetNumDisplays(OCIO_ConstConfigRcPtr* config)
 
106
{
 
107
        return impl->configGetNumDisplays(config);
 
108
}
 
109
 
 
110
const char *OCIO_configGetDisplay(OCIO_ConstConfigRcPtr *config, int index)
 
111
{
 
112
        return impl->configGetDisplay(config, index);
 
113
}
 
114
 
 
115
const char *OCIO_configGetDefaultView(OCIO_ConstConfigRcPtr *config, const char *display)
 
116
{
 
117
        return impl->configGetDefaultView(config, display);
 
118
}
 
119
 
 
120
int OCIO_configGetNumViews(OCIO_ConstConfigRcPtr *config, const char *display)
 
121
{
 
122
        return impl->configGetNumViews(config, display);
 
123
}
 
124
 
 
125
const char *OCIO_configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index)
 
126
{
 
127
        return impl->configGetView(config, display, index);
 
128
}
 
129
 
 
130
const char *OCIO_configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view)
 
131
{
 
132
        return impl->configGetDisplayColorSpaceName(config, display, view);
 
133
}
 
134
 
 
135
int OCIO_colorSpaceIsInvertible(OCIO_ConstColorSpaceRcPtr *cs)
 
136
{
 
137
        return impl->colorSpaceIsInvertible(cs);
 
138
}
 
139
 
 
140
int OCIO_colorSpaceIsData(OCIO_ConstColorSpaceRcPtr *cs)
 
141
{
 
142
        return impl->colorSpaceIsData(cs);
 
143
}
 
144
 
 
145
void OCIO_colorSpaceRelease(OCIO_ConstColorSpaceRcPtr *cs)
 
146
{
 
147
        impl->colorSpaceRelease(cs);
 
148
}
 
149
 
 
150
OCIO_ConstProcessorRcPtr *OCIO_configGetProcessorWithNames(OCIO_ConstConfigRcPtr *config, const char *srcName, const char *dstName)
 
151
{
 
152
        return impl->configGetProcessorWithNames(config, srcName, dstName);
 
153
}
 
154
 
 
155
OCIO_ConstProcessorRcPtr *OCIO_configGetProcessor(OCIO_ConstConfigRcPtr *config, OCIO_ConstTransformRcPtr *transform)
 
156
{
 
157
        return impl->configGetProcessor(config, transform);
 
158
}
 
159
 
 
160
void OCIO_processorApply(OCIO_ConstProcessorRcPtr *processor, OCIO_PackedImageDesc *img)
 
161
{
 
162
        impl->processorApply(processor, img);
 
163
}
 
164
 
 
165
void OCIO_processorApply_predivide(OCIO_ConstProcessorRcPtr *processor, OCIO_PackedImageDesc *img)
 
166
{
 
167
        impl->processorApply_predivide(processor, img);
 
168
}
 
169
 
 
170
void OCIO_processorApplyRGB(OCIO_ConstProcessorRcPtr *processor, float *pixel)
 
171
{
 
172
        impl->processorApplyRGB(processor, pixel);
 
173
}
 
174
 
 
175
void OCIO_processorApplyRGBA(OCIO_ConstProcessorRcPtr *processor, float *pixel)
 
176
{
 
177
        impl->processorApplyRGBA(processor, pixel);
 
178
}
 
179
 
 
180
void OCIO_processorApplyRGBA_predivide(OCIO_ConstProcessorRcPtr *processor, float *pixel)
 
181
{
 
182
        impl->processorApplyRGBA_predivide(processor, pixel);
 
183
}
 
184
 
 
185
void OCIO_processorRelease(OCIO_ConstProcessorRcPtr *p)
 
186
{
 
187
        impl->processorRelease(p);
 
188
}
 
189
 
 
190
const char *OCIO_colorSpaceGetName(OCIO_ConstColorSpaceRcPtr *cs)
 
191
{
 
192
        return impl->colorSpaceGetName(cs);
 
193
}
 
194
 
 
195
const char *OCIO_colorSpaceGetDescription(OCIO_ConstColorSpaceRcPtr *cs)
 
196
{
 
197
        return impl->colorSpaceGetDescription(cs);
 
198
}
 
199
 
 
200
const char *OCIO_colorSpaceGetFamily(OCIO_ConstColorSpaceRcPtr *cs)
 
201
{
 
202
        return impl->colorSpaceGetFamily(cs);
 
203
}
 
204
 
 
205
OCIO_DisplayTransformRcPtr *OCIO_createDisplayTransform(void)
 
206
{
 
207
        return impl->createDisplayTransform();
 
208
}
 
209
 
 
210
void OCIO_displayTransformSetInputColorSpaceName(OCIO_DisplayTransformRcPtr *dt, const char *name)
 
211
{
 
212
        impl->displayTransformSetInputColorSpaceName(dt, name);
 
213
}
 
214
 
 
215
void OCIO_displayTransformSetDisplay(OCIO_DisplayTransformRcPtr *dt, const char *name)
 
216
{
 
217
        impl->displayTransformSetDisplay(dt, name);
 
218
}
 
219
 
 
220
void OCIO_displayTransformSetView(OCIO_DisplayTransformRcPtr *dt, const char *name)
 
221
{
 
222
        impl->displayTransformSetView(dt, name);
 
223
}
 
224
 
 
225
void OCIO_displayTransformSetDisplayCC(OCIO_DisplayTransformRcPtr *dt, OCIO_ConstTransformRcPtr *t)
 
226
{
 
227
        impl->displayTransformSetDisplayCC(dt, t);
 
228
}
 
229
 
 
230
void OCIO_displayTransformSetLinearCC(OCIO_DisplayTransformRcPtr *dt, OCIO_ConstTransformRcPtr *t)
 
231
{
 
232
        impl->displayTransformSetLinearCC(dt, t);
 
233
}
 
234
 
 
235
void OCIO_displayTransformRelease(OCIO_DisplayTransformRcPtr *dt)
 
236
{
 
237
        impl->displayTransformRelease(dt);
 
238
}
 
239
 
 
240
OCIO_PackedImageDesc *OCIO_createOCIO_PackedImageDesc(float *data, long width, long height, long numChannels,
 
241
                                                      long chanStrideBytes, long xStrideBytes, long yStrideBytes)
 
242
{
 
243
        return impl->createOCIO_PackedImageDesc(data, width, height, numChannels, chanStrideBytes, xStrideBytes, yStrideBytes);
 
244
}
 
245
 
 
246
void OCIO_PackedImageDescRelease(OCIO_PackedImageDesc* id)
 
247
{
 
248
        impl->OCIO_PackedImageDescRelease(id);
 
249
}
 
250
 
 
251
OCIO_ExponentTransformRcPtr *OCIO_createExponentTransform(void)
 
252
{
 
253
        return impl->createExponentTransform();
 
254
}
 
255
 
 
256
void OCIO_exponentTransformSetValue(OCIO_ExponentTransformRcPtr *et, const float *exponent)
 
257
{
 
258
        impl->exponentTransformSetValue(et, exponent);
 
259
}
 
260
 
 
261
void OCIO_exponentTransformRelease(OCIO_ExponentTransformRcPtr *et)
 
262
{
 
263
        impl->exponentTransformRelease(et);
 
264
}
 
265
 
 
266
OCIO_MatrixTransformRcPtr *OCIO_createMatrixTransform(void)
 
267
{
 
268
        return impl->createMatrixTransform();
 
269
}
 
270
 
 
271
void OCIO_matrixTransformSetValue(OCIO_MatrixTransformRcPtr *mt, const float *m44, const float *offset4)
 
272
{
 
273
        impl->matrixTransformSetValue(mt, m44, offset4);
 
274
}
 
275
 
 
276
void OCIO_matrixTransformRelease(OCIO_MatrixTransformRcPtr *mt)
 
277
{
 
278
        impl->matrixTransformRelease(mt);
 
279
}
 
280
 
 
281
void OCIO_matrixTransformScale(float * m44, float * offset4, const float *scale4f)
 
282
{
 
283
        impl->matrixTransformScale(m44, offset4, scale4f);
 
284
}