9 #if defined(CL_JPEG_SOFTWARE) && !defined(CL_JPEG_COSMO)
10 #include <dmedia/cl_cosmo.h>
16 int ob_isCompressor
; /* Compressor or Decompressor */
17 CL_Handle ob_compressorHdl
;
22 static PyObject
*ClError
; /* exception cl.error */
24 static int error_handler_called
= 0;
27 * We want to use the function prototypes that are available in the C
28 * compiler on the SGI. Because of that, we need to declare the first
29 * argument of the compressor and decompressor methods as "object *",
30 * even though they are really "clobject *". Therefore we cast the
31 * argument to the proper type using this macro.
33 #define SELF ((clobject *) self)
35 /********************************************************************
37 ********************************************************************/
39 cl_ErrorHandler(CL_Handle handle
, int code
, const char *fmt
, ...)
42 char errbuf
[BUFSIZ
]; /* hopefully big enough */
45 if (PyErr_Occurred()) /* don't change existing error */
47 error_handler_called
= 1;
49 vsprintf(errbuf
, fmt
, ap
);
51 p
= &errbuf
[strlen(errbuf
) - 1]; /* swat the line feed */
54 PyErr_SetString(ClError
, errbuf
);
58 * This assumes that params are always in the range 0 to some maximum.
61 param_type_is_float(clobject
*self
, int param
)
65 if (self
->ob_paramtypes
== NULL
) {
66 error_handler_called
= 0;
67 bufferlength
= clQueryParams(self
->ob_compressorHdl
, 0, 0);
68 if (error_handler_called
)
71 self
->ob_paramtypes
= PyMem_NEW(int, bufferlength
);
72 if (self
->ob_paramtypes
== NULL
)
74 self
->ob_nparams
= bufferlength
/ 2;
76 (void) clQueryParams(self
->ob_compressorHdl
,
77 self
->ob_paramtypes
, bufferlength
);
78 if (error_handler_called
) {
79 PyMem_DEL(self
->ob_paramtypes
);
80 self
->ob_paramtypes
= NULL
;
85 if (param
< 0 || param
>= self
->ob_nparams
)
88 if (self
->ob_paramtypes
[param
*2 + 1] == CL_FLOATING_ENUM_VALUE
||
89 self
->ob_paramtypes
[param
*2 + 1] == CL_FLOATING_RANGE_VALUE
)
95 /********************************************************************
96 Single image compression/decompression.
97 ********************************************************************/
99 cl_CompressImage(PyObject
*self
, PyObject
*args
)
101 int compressionScheme
, width
, height
, originalFormat
;
102 float compressionRatio
;
103 int frameBufferSize
, compressedBufferSize
;
105 PyObject
*compressedBuffer
;
107 if (!PyArg_ParseTuple(args
, "iiiifs#", &compressionScheme
,
109 &originalFormat
, &compressionRatio
, &frameBuffer
,
114 compressedBuffer
= PyString_FromStringAndSize(NULL
, frameBufferSize
);
115 if (compressedBuffer
== NULL
)
118 compressedBufferSize
= frameBufferSize
;
119 error_handler_called
= 0;
120 if (clCompressImage(compressionScheme
, width
, height
, originalFormat
,
121 compressionRatio
, (void *) frameBuffer
,
122 &compressedBufferSize
,
123 (void *) PyString_AsString(compressedBuffer
))
124 == FAILURE
|| error_handler_called
) {
125 Py_DECREF(compressedBuffer
);
126 if (!error_handler_called
)
127 PyErr_SetString(ClError
, "clCompressImage failed");
131 if (compressedBufferSize
> frameBufferSize
) {
132 frameBufferSize
= compressedBufferSize
;
133 Py_DECREF(compressedBuffer
);
137 if (compressedBufferSize
< frameBufferSize
)
138 _PyString_Resize(&compressedBuffer
, compressedBufferSize
);
140 return compressedBuffer
;
144 cl_DecompressImage(PyObject
*self
, PyObject
*args
)
146 int compressionScheme
, width
, height
, originalFormat
;
147 char *compressedBuffer
;
148 int compressedBufferSize
, frameBufferSize
;
149 PyObject
*frameBuffer
;
151 if (!PyArg_ParseTuple(args
, "iiiis#", &compressionScheme
, &width
, &height
,
152 &originalFormat
, &compressedBuffer
,
153 &compressedBufferSize
))
156 frameBufferSize
= width
* height
* CL_BytesPerPixel(originalFormat
);
158 frameBuffer
= PyString_FromStringAndSize(NULL
, frameBufferSize
);
159 if (frameBuffer
== NULL
)
162 error_handler_called
= 0;
163 if (clDecompressImage(compressionScheme
, width
, height
, originalFormat
,
164 compressedBufferSize
, compressedBuffer
,
165 (void *) PyString_AsString(frameBuffer
))
166 == FAILURE
|| error_handler_called
) {
167 Py_DECREF(frameBuffer
);
168 if (!error_handler_called
)
169 PyErr_SetString(ClError
, "clDecompressImage failed");
176 /********************************************************************
177 Sequential compression/decompression.
178 ********************************************************************/
179 #define CheckCompressor(self) if ((self)->ob_compressorHdl == NULL) { \
180 PyErr_SetString(PyExc_RuntimeError, "(de)compressor not active"); \
185 doClose(clobject
*self
, int (*close_func
)(CL_Handle
))
187 CheckCompressor(self
);
189 error_handler_called
= 0;
190 if ((*close_func
)(self
->ob_compressorHdl
) == FAILURE
||
191 error_handler_called
) {
192 if (!error_handler_called
)
193 PyErr_SetString(ClError
, "close failed");
197 self
->ob_compressorHdl
= NULL
;
199 if (self
->ob_paramtypes
)
200 PyMem_DEL(self
->ob_paramtypes
);
201 self
->ob_paramtypes
= NULL
;
208 clm_CloseCompressor(PyObject
*self
)
210 return doClose(SELF
, clCloseCompressor
);
214 clm_CloseDecompressor(PyObject
*self
)
216 return doClose(SELF
, clCloseDecompressor
);
220 clm_Compress(PyObject
*self
, PyObject
*args
)
223 int frameBufferSize
, compressedBufferSize
, size
;
227 CheckCompressor(SELF
);
229 if (!PyArg_Parse(args
, "(is#)", &numberOfFrames
,
230 &frameBuffer
, &frameBufferSize
))
233 error_handler_called
= 0;
234 size
= clGetParam(SELF
->ob_compressorHdl
, CL_COMPRESSED_BUFFER_SIZE
);
235 compressedBufferSize
= size
;
236 if (error_handler_called
)
239 data
= PyString_FromStringAndSize(NULL
, size
);
243 error_handler_called
= 0;
244 if (clCompress(SELF
->ob_compressorHdl
, numberOfFrames
,
245 (void *) frameBuffer
, &compressedBufferSize
,
246 (void *) PyString_AsString(data
)) == FAILURE
||
247 error_handler_called
) {
249 if (!error_handler_called
)
250 PyErr_SetString(ClError
, "compress failed");
254 if (compressedBufferSize
< size
)
255 if (_PyString_Resize(&data
, compressedBufferSize
))
258 if (compressedBufferSize
> size
) {
259 /* we didn't get all "compressed" data */
261 PyErr_SetString(ClError
,
262 "compressed data is more than fitted");
270 clm_Decompress(PyObject
*self
, PyObject
*args
)
274 char *compressedData
;
275 int compressedDataSize
, dataSize
;
277 CheckCompressor(SELF
);
279 if (!PyArg_Parse(args
, "(is#)", &numberOfFrames
, &compressedData
,
280 &compressedDataSize
))
283 error_handler_called
= 0;
284 dataSize
= clGetParam(SELF
->ob_compressorHdl
, CL_FRAME_BUFFER_SIZE
);
285 if (error_handler_called
)
288 data
= PyString_FromStringAndSize(NULL
, dataSize
);
292 error_handler_called
= 0;
293 if (clDecompress(SELF
->ob_compressorHdl
, numberOfFrames
,
294 compressedDataSize
, (void *) compressedData
,
295 (void *) PyString_AsString(data
)) == FAILURE
||
296 error_handler_called
) {
298 if (!error_handler_called
)
299 PyErr_SetString(ClError
, "decompress failed");
307 doParams(clobject
*self
, PyObject
*args
, int (*func
)(CL_Handle
, int *, int),
316 CheckCompressor(self
);
318 if (!PyArg_Parse(args
, "O", &list
))
320 if (!PyList_Check(list
)) {
324 length
= PyList_Size(list
);
325 PVbuffer
= PyMem_NEW(int, length
);
326 if (PVbuffer
== NULL
)
327 return PyErr_NoMemory();
328 for (i
= 0; i
< length
; i
++) {
329 v
= PyList_GetItem(list
, i
);
330 if (PyFloat_Check(v
)) {
331 number
= PyFloat_AsDouble(v
);
332 PVbuffer
[i
] = CL_TypeIsInt(number
);
333 } else if (PyInt_Check(v
)) {
334 PVbuffer
[i
] = PyInt_AsLong(v
);
336 param_type_is_float(self
, PVbuffer
[i
-1]) > 0) {
337 number
= PVbuffer
[i
];
338 PVbuffer
[i
] = CL_TypeIsInt(number
);
347 error_handler_called
= 0;
348 (*func
)(self
->ob_compressorHdl
, PVbuffer
, length
);
349 if (error_handler_called
) {
355 for (i
= 0; i
< length
; i
++) {
357 param_type_is_float(self
, PVbuffer
[i
-1]) > 0) {
358 number
= CL_TypeIsFloat(PVbuffer
[i
]);
359 v
= PyFloat_FromDouble(number
);
361 v
= PyInt_FromLong(PVbuffer
[i
]);
362 PyList_SetItem(list
, i
, v
);
373 clm_GetParams(PyObject
*self
, PyObject
*args
)
375 return doParams(SELF
, args
, clGetParams
, 1);
379 clm_SetParams(PyObject
*self
, PyObject
*args
)
381 return doParams(SELF
, args
, clSetParams
, 0);
385 do_get(clobject
*self
, PyObject
*args
, int (*func
)(CL_Handle
, int))
390 CheckCompressor(self
);
392 if (!PyArg_Parse(args
, "i", ¶mID
))
395 error_handler_called
= 0;
396 value
= (*func
)(self
->ob_compressorHdl
, paramID
);
397 if (error_handler_called
)
400 if (param_type_is_float(self
, paramID
) > 0) {
401 fvalue
= CL_TypeIsFloat(value
);
402 return PyFloat_FromDouble(fvalue
);
405 return PyInt_FromLong(value
);
409 clm_GetParam(PyObject
*self
, PyObject
*args
)
411 return do_get(SELF
, args
, clGetParam
);
415 clm_GetDefault(PyObject
*self
, PyObject
*args
)
417 return do_get(SELF
, args
, clGetDefault
);
421 clm_SetParam(PyObject
*self
, PyObject
*args
)
426 CheckCompressor(SELF
);
428 if (!PyArg_Parse(args
, "(ii)", ¶mID
, &value
)) {
430 if (!PyArg_Parse(args
, "(if)", ¶mID
, &fvalue
)) {
432 PyErr_SetString(PyExc_TypeError
,
433 "bad argument list (format '(ii)' or '(if)')");
436 value
= CL_TypeIsInt(fvalue
);
438 if (param_type_is_float(SELF
, paramID
) > 0) {
440 value
= CL_TypeIsInt(fvalue
);
444 error_handler_called
= 0;
445 value
= clSetParam(SELF
->ob_compressorHdl
, paramID
, value
);
446 if (error_handler_called
)
449 if (param_type_is_float(SELF
, paramID
) > 0)
450 return PyFloat_FromDouble(CL_TypeIsFloat(value
));
452 return PyInt_FromLong(value
);
456 clm_GetParamID(PyObject
*self
, PyObject
*args
)
461 CheckCompressor(SELF
);
463 if (!PyArg_Parse(args
, "s", &name
))
466 error_handler_called
= 0;
467 value
= clGetParamID(SELF
->ob_compressorHdl
, name
);
468 if (value
== FAILURE
|| error_handler_called
) {
469 if (!error_handler_called
)
470 PyErr_SetString(ClError
, "getparamid failed");
474 return PyInt_FromLong(value
);
478 clm_QueryParams(PyObject
*self
)
485 CheckCompressor(SELF
);
487 error_handler_called
= 0;
488 bufferlength
= clQueryParams(SELF
->ob_compressorHdl
, 0, 0);
489 if (error_handler_called
)
492 PVbuffer
= PyMem_NEW(int, bufferlength
);
493 if (PVbuffer
== NULL
)
494 return PyErr_NoMemory();
496 bufferlength
= clQueryParams(SELF
->ob_compressorHdl
, PVbuffer
,
498 if (error_handler_called
) {
503 list
= PyList_New(bufferlength
);
509 for (i
= 0; i
< bufferlength
; i
++) {
511 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
512 else if (PVbuffer
[i
] == 0) {
514 PyList_SetItem(list
, i
, Py_None
);
516 PyList_SetItem(list
, i
,
517 PyString_FromString((char *) PVbuffer
[i
]));
526 clm_GetMinMax(PyObject
*self
, PyObject
*args
)
531 CheckCompressor(SELF
);
533 if (!PyArg_Parse(args
, "i", ¶m
))
536 clGetMinMax(SELF
->ob_compressorHdl
, param
, &min
, &max
);
538 if (param_type_is_float(SELF
, param
) > 0) {
539 fmin
= CL_TypeIsFloat(min
);
540 fmax
= CL_TypeIsFloat(max
);
541 return Py_BuildValue("(ff)", fmin
, fmax
);
544 return Py_BuildValue("(ii)", min
, max
);
548 clm_GetName(PyObject
*self
, PyObject
*args
)
553 CheckCompressor(SELF
);
555 if (!PyArg_Parse(args
, "i", ¶m
))
558 error_handler_called
= 0;
559 name
= clGetName(SELF
->ob_compressorHdl
, param
);
560 if (name
== NULL
|| error_handler_called
) {
561 if (!error_handler_called
)
562 PyErr_SetString(ClError
, "getname failed");
566 return PyString_FromString(name
);
570 clm_QuerySchemeFromHandle(PyObject
*self
)
572 CheckCompressor(SELF
);
573 return PyInt_FromLong(clQuerySchemeFromHandle(SELF
->ob_compressorHdl
));
577 clm_ReadHeader(PyObject
*self
, PyObject
*args
)
582 CheckCompressor(SELF
);
584 if (!PyArg_Parse(args
, "s#", &header
, &headerSize
))
587 return PyInt_FromLong(clReadHeader(SELF
->ob_compressorHdl
,
588 headerSize
, header
));
591 static PyMethodDef compressor_methods
[] = {
592 {"close", clm_CloseCompressor
, METH_NOARGS
}, /* alias */
593 {"CloseCompressor", clm_CloseCompressor
, METH_NOARGS
},
594 {"Compress", clm_Compress
, METH_OLDARGS
},
595 {"GetDefault", clm_GetDefault
, METH_OLDARGS
},
596 {"GetMinMax", clm_GetMinMax
, METH_OLDARGS
},
597 {"GetName", clm_GetName
, METH_OLDARGS
},
598 {"GetParam", clm_GetParam
, METH_OLDARGS
},
599 {"GetParamID", clm_GetParamID
, METH_OLDARGS
},
600 {"GetParams", clm_GetParams
, METH_OLDARGS
},
601 {"QueryParams", clm_QueryParams
, METH_NOARGS
},
602 {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle
, METH_NOARGS
},
603 {"SetParam", clm_SetParam
, METH_OLDARGS
},
604 {"SetParams", clm_SetParams
, METH_OLDARGS
},
605 {NULL
, NULL
} /* sentinel */
608 static PyMethodDef decompressor_methods
[] = {
609 {"close", clm_CloseDecompressor
, METH_NOARGS
}, /* alias */
610 {"CloseDecompressor", clm_CloseDecompressor
, METH_NOARGS
},
611 {"Decompress", clm_Decompress
, METH_OLDARGS
},
612 {"GetDefault", clm_GetDefault
, METH_OLDARGS
},
613 {"GetMinMax", clm_GetMinMax
, METH_OLDARGS
},
614 {"GetName", clm_GetName
, METH_OLDARGS
},
615 {"GetParam", clm_GetParam
, METH_OLDARGS
},
616 {"GetParamID", clm_GetParamID
, METH_OLDARGS
},
617 {"GetParams", clm_GetParams
, METH_OLDARGS
},
618 {"ReadHeader", clm_ReadHeader
, METH_OLDARGS
},
619 {"QueryParams", clm_QueryParams
, METH_NOARGS
},
620 {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle
, METH_NOARGS
},
621 {"SetParam", clm_SetParam
, METH_OLDARGS
},
622 {"SetParams", clm_SetParams
, METH_OLDARGS
},
623 {NULL
, NULL
} /* sentinel */
627 cl_dealloc(PyObject
*self
)
629 if (SELF
->ob_compressorHdl
) {
630 if (SELF
->ob_isCompressor
)
631 clCloseCompressor(SELF
->ob_compressorHdl
);
633 clCloseDecompressor(SELF
->ob_compressorHdl
);
639 cl_getattr(PyObject
*self
, char *name
)
641 if (SELF
->ob_isCompressor
)
642 return Py_FindMethod(compressor_methods
, self
, name
);
644 return Py_FindMethod(decompressor_methods
, self
, name
);
647 static PyTypeObject Cltype
= {
648 PyObject_HEAD_INIT(&PyType_Type
)
651 sizeof(clobject
), /*tp_size*/
654 (destructor
)cl_dealloc
, /*tp_dealloc*/
656 (getattrfunc
)cl_getattr
, /*tp_getattr*/
661 0, /*tp_as_sequence*/
666 doOpen(PyObject
*self
, PyObject
*args
, int (*open_func
)(int, CL_Handle
*),
672 if (!PyArg_ParseTuple(args
, "i", &scheme
))
675 new = PyObject_New(clobject
, &Cltype
);
679 new->ob_compressorHdl
= NULL
;
680 new->ob_isCompressor
= iscompressor
;
681 new->ob_paramtypes
= NULL
;
683 error_handler_called
= 0;
684 if ((*open_func
)(scheme
, &new->ob_compressorHdl
) == FAILURE
||
685 error_handler_called
) {
687 if (!error_handler_called
)
688 PyErr_SetString(ClError
, "Open(De)Compressor failed");
691 return (PyObject
*)new;
695 cl_OpenCompressor(PyObject
*self
, PyObject
*args
)
697 return doOpen(self
, args
, clOpenCompressor
, 1);
701 cl_OpenDecompressor(PyObject
*self
, PyObject
*args
)
703 return doOpen(self
, args
, clOpenDecompressor
, 0);
707 cl_QueryScheme(PyObject
*self
, PyObject
*args
)
713 if (!PyArg_ParseTuple(args
, "s#", &header
, &headerlen
))
716 scheme
= clQueryScheme(header
);
718 PyErr_SetString(ClError
, "unknown compression scheme");
722 return PyInt_FromLong(scheme
);
726 cl_QueryMaxHeaderSize(PyObject
*self
, PyObject
*args
)
730 if (!PyArg_ParseTuple(args
, "i", &scheme
))
733 return PyInt_FromLong(clQueryMaxHeaderSize(scheme
));
737 cl_QueryAlgorithms(PyObject
*self
, PyObject
*args
)
739 int algorithmMediaType
;
745 if (!PyArg_ParseTuple(args
, "i", &algorithmMediaType
))
748 error_handler_called
= 0;
749 bufferlength
= clQueryAlgorithms(algorithmMediaType
, 0, 0);
750 if (error_handler_called
)
753 PVbuffer
= PyMem_NEW(int, bufferlength
);
754 if (PVbuffer
== NULL
)
755 return PyErr_NoMemory();
757 bufferlength
= clQueryAlgorithms(algorithmMediaType
, PVbuffer
,
759 if (error_handler_called
) {
764 list
= PyList_New(bufferlength
);
770 for (i
= 0; i
< bufferlength
; i
++) {
772 PyList_SetItem(list
, i
, PyInt_FromLong(PVbuffer
[i
]));
773 else if (PVbuffer
[i
] == 0) {
775 PyList_SetItem(list
, i
, Py_None
);
777 PyList_SetItem(list
, i
,
778 PyString_FromString((char *) PVbuffer
[i
]));
787 cl_QuerySchemeFromName(PyObject
*self
, PyObject
*args
)
789 int algorithmMediaType
;
793 if (!PyArg_ParseTuple(args
, "is", &algorithmMediaType
, &name
))
796 error_handler_called
= 0;
797 scheme
= clQuerySchemeFromName(algorithmMediaType
, name
);
798 if (error_handler_called
) {
799 PyErr_SetString(ClError
, "unknown compression scheme");
803 return PyInt_FromLong(scheme
);
807 cl_GetAlgorithmName(PyObject
*self
, PyObject
*args
)
812 if (!PyArg_ParseTuple(args
, "i", &scheme
))
815 name
= clGetAlgorithmName(scheme
);
817 PyErr_SetString(ClError
, "unknown compression scheme");
821 return PyString_FromString(name
);
825 do_set(PyObject
*self
, PyObject
*args
, int (*func
)(int, int, int))
827 int scheme
, paramID
, value
;
831 if (!PyArg_ParseTuple(args
, "iii", &scheme
, ¶mID
, &value
)) {
833 if (!PyArg_ParseTuple(args
, "iif", &scheme
, ¶mID
, &fvalue
)) {
835 PyErr_SetString(PyExc_TypeError
,
836 "bad argument list (format '(iii)' or '(iif)')");
839 value
= CL_TypeIsInt(fvalue
);
842 /* check some parameters which we know to be floats */
844 case CL_COMPRESSION_RATIO
:
847 value
= CL_TypeIsInt(fvalue
);
853 error_handler_called
= 0;
854 value
= (*func
)(scheme
, paramID
, value
);
855 if (error_handler_called
)
859 return PyFloat_FromDouble(CL_TypeIsFloat(value
));
861 return PyInt_FromLong(value
);
865 cl_SetDefault(PyObject
*self
, PyObject
*args
)
867 return do_set(self
, args
, clSetDefault
);
871 cl_SetMin(PyObject
*self
, PyObject
*args
)
873 return do_set(self
, args
, clSetMin
);
877 cl_SetMax(PyObject
*self
, PyObject
*args
)
879 return do_set(self
, args
, clSetMax
);
882 #define func(name, handler) \
883 static PyObject *cl_##name(PyObject *self, PyObject *args) \
886 if (!PyArg_ParseTuple(args, "i", &x)) return NULL; \
887 return Py##handler(CL_##name(x)); \
890 #define func2(name, handler) \
891 static PyObject *cl_##name(PyObject *self, PyObject *args) \
894 if (!PyArg_ParseTuple(args, "ii", &a1, &a2)) return NULL; \
895 return Py##handler(CL_##name(a1, a2)); \
898 func(BytesPerSample
, Int_FromLong
)
899 func(BytesPerPixel
, Int_FromLong
)
900 func(AudioFormatName
, String_FromString
)
901 func(VideoFormatName
, String_FromString
)
902 func(AlgorithmNumber
, Int_FromLong
)
903 func(AlgorithmType
, Int_FromLong
)
904 func2(Algorithm
, Int_FromLong
)
905 func(ParamNumber
, Int_FromLong
)
906 func(ParamType
, Int_FromLong
)
907 func2(ParamID
, Int_FromLong
)
911 cvt_type(PyObject
*self
, PyObject
*args
)
916 if (PyArg_Parse(args
, "i", &number
))
917 return PyFloat_FromDouble(CL_TypeIsFloat(number
));
920 if (PyArg_Parse(args
, "f", &fnumber
))
921 return PyInt_FromLong(CL_TypeIsInt(fnumber
));
927 static PyMethodDef cl_methods
[] = {
928 {"CompressImage", cl_CompressImage
, METH_VARARGS
},
929 {"DecompressImage", cl_DecompressImage
, METH_VARARGS
},
930 {"GetAlgorithmName", cl_GetAlgorithmName
, METH_VARARGS
},
931 {"OpenCompressor", cl_OpenCompressor
, METH_VARARGS
},
932 {"OpenDecompressor", cl_OpenDecompressor
, METH_VARARGS
},
933 {"QueryAlgorithms", cl_QueryAlgorithms
, METH_VARARGS
},
934 {"QueryMaxHeaderSize", cl_QueryMaxHeaderSize
, METH_VARARGS
},
935 {"QueryScheme", cl_QueryScheme
, METH_VARARGS
},
936 {"QuerySchemeFromName", cl_QuerySchemeFromName
, METH_VARARGS
},
937 {"SetDefault", cl_SetDefault
, METH_VARARGS
},
938 {"SetMax", cl_SetMax
, METH_VARARGS
},
939 {"SetMin", cl_SetMin
, METH_VARARGS
},
940 {"BytesPerSample", cl_BytesPerSample
, METH_VARARGS
},
941 {"BytesPerPixel", cl_BytesPerPixel
, METH_VARARGS
},
942 {"AudioFormatName", cl_AudioFormatName
, METH_VARARGS
},
943 {"VideoFormatName", cl_VideoFormatName
, METH_VARARGS
},
944 {"AlgorithmNumber", cl_AlgorithmNumber
, METH_VARARGS
},
945 {"AlgorithmType", cl_AlgorithmType
, METH_VARARGS
},
946 {"Algorithm", cl_Algorithm
, METH_VARARGS
},
947 {"ParamNumber", cl_ParamNumber
, METH_VARARGS
},
948 {"ParamType", cl_ParamType
, METH_VARARGS
},
949 {"ParamID", cl_ParamID
, METH_VARARGS
},
951 {"cvt_type", cvt_type
, METH_VARARGS
},
953 {NULL
, NULL
} /* Sentinel */
956 #ifdef CL_JPEG_SOFTWARE
957 #define IRIX_5_3_LIBRARY
965 m
= Py_InitModule("cl", cl_methods
);
968 d
= PyModule_GetDict(m
);
970 ClError
= PyErr_NewException("cl.error", NULL
, NULL
);
971 (void) PyDict_SetItemString(d
, "error", ClError
);
973 #ifdef CL_ADDED_ALGORITHM_ERROR
974 x
= PyInt_FromLong(CL_ADDED_ALGORITHM_ERROR
);
975 if (x
== NULL
|| PyDict_SetItemString(d
, "ADDED_ALGORITHM_ERROR", x
) < 0)
980 x
= PyInt_FromLong(CL_ALAW
);
981 if (x
== NULL
|| PyDict_SetItemString(d
, "ALAW", x
) < 0)
985 #ifdef CL_ALGORITHM_ID
986 x
= PyInt_FromLong(CL_ALGORITHM_ID
);
987 if (x
== NULL
|| PyDict_SetItemString(d
, "ALGORITHM_ID", x
) < 0)
991 #ifdef CL_ALGORITHM_TABLE_FULL
992 x
= PyInt_FromLong(CL_ALGORITHM_TABLE_FULL
);
993 if (x
== NULL
|| PyDict_SetItemString(d
, "ALGORITHM_TABLE_FULL", x
) < 0)
997 #ifdef CL_ALGORITHM_VERSION
998 x
= PyInt_FromLong(CL_ALGORITHM_VERSION
);
999 if (x
== NULL
|| PyDict_SetItemString(d
, "ALGORITHM_VERSION", x
) < 0)
1004 x
= PyInt_FromLong(CL_ALG_AUDIO
);
1005 if (x
== NULL
|| PyDict_SetItemString(d
, "ALG_AUDIO", x
) < 0)
1010 x
= PyInt_FromLong(CL_ALG_VIDEO
);
1011 if (x
== NULL
|| PyDict_SetItemString(d
, "ALG_VIDEO", x
) < 0)
1016 x
= PyInt_FromLong(CL_AUDIO
);
1017 if (x
== NULL
|| PyDict_SetItemString(d
, "AUDIO", x
) < 0)
1021 #ifdef CL_AWARE_BITRATE_POLICY
1022 x
= PyInt_FromLong(CL_AWARE_BITRATE_POLICY
);
1023 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_BITRATE_POLICY", x
) < 0)
1027 #ifdef CL_AWARE_BITRATE_TARGET
1028 x
= PyInt_FromLong(CL_AWARE_BITRATE_TARGET
);
1029 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_BITRATE_TARGET", x
) < 0)
1033 #ifdef CL_AWARE_CHANNEL_POLICY
1034 x
= PyInt_FromLong(CL_AWARE_CHANNEL_POLICY
);
1035 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_CHANNEL_POLICY", x
) < 0)
1039 #ifdef CL_AWARE_CONST_QUAL
1040 x
= PyInt_FromLong(CL_AWARE_CONST_QUAL
);
1041 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_CONST_QUAL", x
) < 0)
1045 #ifdef CL_AWARE_ERROR
1046 x
= PyInt_FromLong(CL_AWARE_ERROR
);
1047 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_ERROR", x
) < 0)
1051 #ifdef CL_AWARE_FIXED_RATE
1052 x
= PyInt_FromLong(CL_AWARE_FIXED_RATE
);
1053 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_FIXED_RATE", x
) < 0)
1057 #ifdef CL_AWARE_INDEPENDENT
1058 x
= PyInt_FromLong(CL_AWARE_INDEPENDENT
);
1059 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_INDEPENDENT", x
) < 0)
1063 #ifdef CL_AWARE_JOINT_STEREO
1064 x
= PyInt_FromLong(CL_AWARE_JOINT_STEREO
);
1065 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_JOINT_STEREO", x
) < 0)
1069 #ifdef CL_AWARE_LAYER
1070 x
= PyInt_FromLong(CL_AWARE_LAYER
);
1071 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_LAYER", x
) < 0)
1075 #ifdef CL_AWARE_LOSSLESS
1076 x
= PyInt_FromLong(CL_AWARE_LOSSLESS
);
1077 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_LOSSLESS", x
) < 0)
1081 #ifdef CL_AWARE_MPEG_AUDIO
1082 x
= PyInt_FromLong(CL_AWARE_MPEG_AUDIO
);
1083 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_MPEG_AUDIO", x
) < 0)
1087 #ifdef CL_AWARE_MPEG_LAYER_I
1088 x
= PyInt_FromLong(CL_AWARE_MPEG_LAYER_I
);
1089 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_MPEG_LAYER_I", x
) < 0)
1093 #ifdef CL_AWARE_MPEG_LAYER_II
1094 x
= PyInt_FromLong(CL_AWARE_MPEG_LAYER_II
);
1095 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_MPEG_LAYER_II", x
) < 0)
1099 #ifdef CL_AWARE_MULTIRATE
1100 x
= PyInt_FromLong(CL_AWARE_MULTIRATE
);
1101 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_MULTIRATE", x
) < 0)
1105 #ifdef CL_AWARE_NOISE_MARGIN
1106 x
= PyInt_FromLong(CL_AWARE_NOISE_MARGIN
);
1107 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_NOISE_MARGIN", x
) < 0)
1111 #ifdef CL_AWARE_STEREO
1112 x
= PyInt_FromLong(CL_AWARE_STEREO
);
1113 if (x
== NULL
|| PyDict_SetItemString(d
, "AWARE_STEREO", x
) < 0)
1117 #ifdef CL_BAD_ALGORITHM_NAME
1118 x
= PyInt_FromLong(CL_BAD_ALGORITHM_NAME
);
1119 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_ALGORITHM_NAME", x
) < 0)
1123 #ifdef CL_BAD_ALGORITHM_TYPE
1124 x
= PyInt_FromLong(CL_BAD_ALGORITHM_TYPE
);
1125 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_ALGORITHM_TYPE", x
) < 0)
1129 #ifdef CL_BAD_BLOCK_SIZE
1130 x
= PyInt_FromLong(CL_BAD_BLOCK_SIZE
);
1131 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BLOCK_SIZE", x
) < 0)
1136 x
= PyInt_FromLong(CL_BAD_BOARD
);
1137 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BOARD", x
) < 0)
1141 #ifdef CL_BAD_BUFFERING
1142 x
= PyInt_FromLong(CL_BAD_BUFFERING
);
1143 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERING", x
) < 0)
1147 #ifdef CL_BAD_BUFFERLENGTH_NEG
1148 x
= PyInt_FromLong(CL_BAD_BUFFERLENGTH_NEG
);
1149 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_NEG", x
) < 0)
1153 #ifdef CL_BAD_BUFFERLENGTH_ODD
1154 x
= PyInt_FromLong(CL_BAD_BUFFERLENGTH_ODD
);
1155 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFERLENGTH_ODD", x
) < 0)
1159 #ifdef CL_BAD_BUFFER_EXISTS
1160 x
= PyInt_FromLong(CL_BAD_BUFFER_EXISTS
);
1161 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_EXISTS", x
) < 0)
1165 #ifdef CL_BAD_BUFFER_HANDLE
1166 x
= PyInt_FromLong(CL_BAD_BUFFER_HANDLE
);
1167 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_HANDLE", x
) < 0)
1171 #ifdef CL_BAD_BUFFER_POINTER
1172 x
= PyInt_FromLong(CL_BAD_BUFFER_POINTER
);
1173 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_POINTER", x
) < 0)
1177 #ifdef CL_BAD_BUFFER_QUERY_SIZE
1178 x
= PyInt_FromLong(CL_BAD_BUFFER_QUERY_SIZE
);
1179 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_QUERY_SIZE", x
) < 0)
1183 #ifdef CL_BAD_BUFFER_SIZE
1184 x
= PyInt_FromLong(CL_BAD_BUFFER_SIZE
);
1185 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_SIZE", x
) < 0)
1189 #ifdef CL_BAD_BUFFER_SIZE_POINTER
1190 x
= PyInt_FromLong(CL_BAD_BUFFER_SIZE_POINTER
);
1191 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_SIZE_POINTER", x
) < 0)
1195 #ifdef CL_BAD_BUFFER_TYPE
1196 x
= PyInt_FromLong(CL_BAD_BUFFER_TYPE
);
1197 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_BUFFER_TYPE", x
) < 0)
1201 #ifdef CL_BAD_COMPRESSION_SCHEME
1202 x
= PyInt_FromLong(CL_BAD_COMPRESSION_SCHEME
);
1203 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COMPRESSION_SCHEME", x
) < 0)
1207 #ifdef CL_BAD_COMPRESSOR_HANDLE
1208 x
= PyInt_FromLong(CL_BAD_COMPRESSOR_HANDLE
);
1209 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COMPRESSOR_HANDLE", x
) < 0)
1213 #ifdef CL_BAD_COMPRESSOR_HANDLE_POINTER
1214 x
= PyInt_FromLong(CL_BAD_COMPRESSOR_HANDLE_POINTER
);
1215 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_COMPRESSOR_HANDLE_POINTER", x
) < 0)
1219 #ifdef CL_BAD_FRAME_SIZE
1220 x
= PyInt_FromLong(CL_BAD_FRAME_SIZE
);
1221 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FRAME_SIZE", x
) < 0)
1225 #ifdef CL_BAD_FUNCTIONALITY
1226 x
= PyInt_FromLong(CL_BAD_FUNCTIONALITY
);
1227 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FUNCTIONALITY", x
) < 0)
1231 #ifdef CL_BAD_FUNCTION_POINTER
1232 x
= PyInt_FromLong(CL_BAD_FUNCTION_POINTER
);
1233 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_FUNCTION_POINTER", x
) < 0)
1237 #ifdef CL_BAD_HEADER_SIZE
1238 x
= PyInt_FromLong(CL_BAD_HEADER_SIZE
);
1239 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_HEADER_SIZE", x
) < 0)
1243 #ifdef CL_BAD_INITIAL_VALUE
1244 x
= PyInt_FromLong(CL_BAD_INITIAL_VALUE
);
1245 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_INITIAL_VALUE", x
) < 0)
1249 #ifdef CL_BAD_INTERNAL_FORMAT
1250 x
= PyInt_FromLong(CL_BAD_INTERNAL_FORMAT
);
1251 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_INTERNAL_FORMAT", x
) < 0)
1255 #ifdef CL_BAD_LICENSE
1256 x
= PyInt_FromLong(CL_BAD_LICENSE
);
1257 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_LICENSE", x
) < 0)
1261 #ifdef CL_BAD_MIN_GT_MAX
1262 x
= PyInt_FromLong(CL_BAD_MIN_GT_MAX
);
1263 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_MIN_GT_MAX", x
) < 0)
1267 #ifdef CL_BAD_NO_BUFFERSPACE
1268 x
= PyInt_FromLong(CL_BAD_NO_BUFFERSPACE
);
1269 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NO_BUFFERSPACE", x
) < 0)
1273 #ifdef CL_BAD_NUMBER_OF_BLOCKS
1274 x
= PyInt_FromLong(CL_BAD_NUMBER_OF_BLOCKS
);
1275 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_NUMBER_OF_BLOCKS", x
) < 0)
1280 x
= PyInt_FromLong(CL_BAD_PARAM
);
1281 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM", x
) < 0)
1285 #ifdef CL_BAD_PARAM_ID_POINTER
1286 x
= PyInt_FromLong(CL_BAD_PARAM_ID_POINTER
);
1287 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM_ID_POINTER", x
) < 0)
1291 #ifdef CL_BAD_PARAM_TYPE
1292 x
= PyInt_FromLong(CL_BAD_PARAM_TYPE
);
1293 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PARAM_TYPE", x
) < 0)
1297 #ifdef CL_BAD_POINTER
1298 x
= PyInt_FromLong(CL_BAD_POINTER
);
1299 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_POINTER", x
) < 0)
1303 #ifdef CL_BAD_PVBUFFER
1304 x
= PyInt_FromLong(CL_BAD_PVBUFFER
);
1305 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_PVBUFFER", x
) < 0)
1309 #ifdef CL_BAD_SCHEME_POINTER
1310 x
= PyInt_FromLong(CL_BAD_SCHEME_POINTER
);
1311 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_SCHEME_POINTER", x
) < 0)
1315 #ifdef CL_BAD_STREAM_HEADER
1316 x
= PyInt_FromLong(CL_BAD_STREAM_HEADER
);
1317 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_STREAM_HEADER", x
) < 0)
1321 #ifdef CL_BAD_STRING_POINTER
1322 x
= PyInt_FromLong(CL_BAD_STRING_POINTER
);
1323 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_STRING_POINTER", x
) < 0)
1327 #ifdef CL_BAD_TEXT_STRING_PTR
1328 x
= PyInt_FromLong(CL_BAD_TEXT_STRING_PTR
);
1329 if (x
== NULL
|| PyDict_SetItemString(d
, "BAD_TEXT_STRING_PTR", x
) < 0)
1334 x
= PyInt_FromLong(CL_BEST_FIT
);
1335 if (x
== NULL
|| PyDict_SetItemString(d
, "BEST_FIT", x
) < 0)
1339 #ifdef CL_BIDIRECTIONAL
1340 x
= PyInt_FromLong(CL_BIDIRECTIONAL
);
1341 if (x
== NULL
|| PyDict_SetItemString(d
, "BIDIRECTIONAL", x
) < 0)
1346 x
= PyInt_FromLong(CL_BITRATE
);
1347 if (x
== NULL
|| PyDict_SetItemString(d
, "BITRATE", x
) < 0)
1351 #ifdef CL_BITRATE_POLICY
1352 x
= PyInt_FromLong(CL_BITRATE_POLICY
);
1353 if (x
== NULL
|| PyDict_SetItemString(d
, "BITRATE_POLICY", x
) < 0)
1357 #ifdef CL_BITRATE_TARGET
1358 x
= PyInt_FromLong(CL_BITRATE_TARGET
);
1359 if (x
== NULL
|| PyDict_SetItemString(d
, "BITRATE_TARGET", x
) < 0)
1363 #ifdef CL_BITS_PER_COMPONENT
1364 x
= PyInt_FromLong(CL_BITS_PER_COMPONENT
);
1365 if (x
== NULL
|| PyDict_SetItemString(d
, "BITS_PER_COMPONENT", x
) < 0)
1370 x
= PyInt_FromLong(CL_BLENDING
);
1371 if (x
== NULL
|| PyDict_SetItemString(d
, "BLENDING", x
) < 0)
1375 #ifdef CL_BLOCK_SIZE
1376 x
= PyInt_FromLong(CL_BLOCK_SIZE
);
1377 if (x
== NULL
|| PyDict_SetItemString(d
, "BLOCK_SIZE", x
) < 0)
1382 x
= PyInt_FromLong(CL_BOTTOM_UP
);
1383 if (x
== NULL
|| PyDict_SetItemString(d
, "BOTTOM_UP", x
) < 0)
1387 #ifdef CL_BUFFER_NOT_CREATED
1388 x
= PyInt_FromLong(CL_BUFFER_NOT_CREATED
);
1389 if (x
== NULL
|| PyDict_SetItemString(d
, "BUFFER_NOT_CREATED", x
) < 0)
1393 #ifdef CL_BUF_COMPRESSED
1394 x
= PyInt_FromLong(CL_BUF_COMPRESSED
);
1395 if (x
== NULL
|| PyDict_SetItemString(d
, "BUF_COMPRESSED", x
) < 0)
1400 x
= PyInt_FromLong(CL_BUF_DATA
);
1401 if (x
== NULL
|| PyDict_SetItemString(d
, "BUF_DATA", x
) < 0)
1406 x
= PyInt_FromLong(CL_BUF_FRAME
);
1407 if (x
== NULL
|| PyDict_SetItemString(d
, "BUF_FRAME", x
) < 0)
1411 #ifdef CL_CHANNEL_POLICY
1412 x
= PyInt_FromLong(CL_CHANNEL_POLICY
);
1413 if (x
== NULL
|| PyDict_SetItemString(d
, "CHANNEL_POLICY", x
) < 0)
1417 #ifdef CL_CHROMA_THRESHOLD
1418 x
= PyInt_FromLong(CL_CHROMA_THRESHOLD
);
1419 if (x
== NULL
|| PyDict_SetItemString(d
, "CHROMA_THRESHOLD", x
) < 0)
1424 x
= PyInt_FromLong(CL_CODEC
);
1425 if (x
== NULL
|| PyDict_SetItemString(d
, "CODEC", x
) < 0)
1429 #ifdef CL_COMPONENTS
1430 x
= PyInt_FromLong(CL_COMPONENTS
);
1431 if (x
== NULL
|| PyDict_SetItemString(d
, "COMPONENTS", x
) < 0)
1435 #ifdef CL_COMPRESSED_BUFFER_SIZE
1436 x
= PyInt_FromLong(CL_COMPRESSED_BUFFER_SIZE
);
1437 if (x
== NULL
|| PyDict_SetItemString(d
, "COMPRESSED_BUFFER_SIZE", x
) < 0)
1441 #ifdef CL_COMPRESSION_RATIO
1442 x
= PyInt_FromLong(CL_COMPRESSION_RATIO
);
1443 if (x
== NULL
|| PyDict_SetItemString(d
, "COMPRESSION_RATIO", x
) < 0)
1447 #ifdef CL_COMPRESSOR
1448 x
= PyInt_FromLong(CL_COMPRESSOR
);
1449 if (x
== NULL
|| PyDict_SetItemString(d
, "COMPRESSOR", x
) < 0)
1453 #ifdef CL_CONTINUOUS_BLOCK
1454 x
= PyInt_FromLong(CL_CONTINUOUS_BLOCK
);
1455 if (x
== NULL
|| PyDict_SetItemString(d
, "CONTINUOUS_BLOCK", x
) < 0)
1459 #ifdef CL_CONTINUOUS_NONBLOCK
1460 x
= PyInt_FromLong(CL_CONTINUOUS_NONBLOCK
);
1461 if (x
== NULL
|| PyDict_SetItemString(d
, "CONTINUOUS_NONBLOCK", x
) < 0)
1465 #ifdef CL_COSMO_CODEC_CONTROL
1466 x
= PyInt_FromLong(CL_COSMO_CODEC_CONTROL
);
1467 if (x
== NULL
|| PyDict_SetItemString(d
, "COSMO_CODEC_CONTROL", x
) < 0)
1471 #ifdef CL_COSMO_NUM_PARAMS
1472 x
= PyInt_FromLong(CL_COSMO_NUM_PARAMS
);
1473 if (x
== NULL
|| PyDict_SetItemString(d
, "COSMO_NUM_PARAMS", x
) < 0)
1477 #ifdef CL_COSMO_VALUE_BASE
1478 x
= PyInt_FromLong(CL_COSMO_VALUE_BASE
);
1479 if (x
== NULL
|| PyDict_SetItemString(d
, "COSMO_VALUE_BASE", x
) < 0)
1483 #ifdef CL_COSMO_VIDEO_MANUAL_CONTROL
1484 x
= PyInt_FromLong(CL_COSMO_VIDEO_MANUAL_CONTROL
);
1485 if (x
== NULL
|| PyDict_SetItemString(d
, "COSMO_VIDEO_MANUAL_CONTROL", x
) < 0)
1489 #ifdef CL_COSMO_VIDEO_TRANSFER_MODE
1490 x
= PyInt_FromLong(CL_COSMO_VIDEO_TRANSFER_MODE
);
1491 if (x
== NULL
|| PyDict_SetItemString(d
, "COSMO_VIDEO_TRANSFER_MODE", x
) < 0)
1496 x
= PyInt_FromLong(CL_DATA
);
1497 if (x
== NULL
|| PyDict_SetItemString(d
, "DATA", x
) < 0)
1501 #ifdef CL_DECOMPRESSOR
1502 x
= PyInt_FromLong(CL_DECOMPRESSOR
);
1503 if (x
== NULL
|| PyDict_SetItemString(d
, "DECOMPRESSOR", x
) < 0)
1508 x
= PyInt_FromLong(CL_DSO_ERROR
);
1509 if (x
== NULL
|| PyDict_SetItemString(d
, "DSO_ERROR", x
) < 0)
1513 #ifdef CL_EDGE_THRESHOLD
1514 x
= PyInt_FromLong(CL_EDGE_THRESHOLD
);
1515 if (x
== NULL
|| PyDict_SetItemString(d
, "EDGE_THRESHOLD", x
) < 0)
1519 #ifdef CL_ENABLE_IMAGEINFO
1520 x
= PyInt_FromLong(CL_ENABLE_IMAGEINFO
);
1521 if (x
== NULL
|| PyDict_SetItemString(d
, "ENABLE_IMAGEINFO", x
) < 0)
1525 #ifdef CL_END_OF_SEQUENCE
1526 x
= PyInt_FromLong(CL_END_OF_SEQUENCE
);
1527 if (x
== NULL
|| PyDict_SetItemString(d
, "END_OF_SEQUENCE", x
) < 0)
1531 #ifdef CL_ENUM_VALUE
1532 x
= PyInt_FromLong(CL_ENUM_VALUE
);
1533 if (x
== NULL
|| PyDict_SetItemString(d
, "ENUM_VALUE", x
) < 0)
1537 #ifdef CL_EXACT_COMPRESSION_RATIO
1538 x
= PyInt_FromLong(CL_EXACT_COMPRESSION_RATIO
);
1539 if (x
== NULL
|| PyDict_SetItemString(d
, "EXACT_COMPRESSION_RATIO", x
) < 0)
1543 #ifdef CL_EXTERNAL_DEVICE
1544 x
= PyInt_FromLong((long) CL_EXTERNAL_DEVICE
);
1545 if (x
== NULL
|| PyDict_SetItemString(d
, "EXTERNAL_DEVICE", x
) < 0)
1549 #ifdef CL_FLOATING_ENUM_VALUE
1550 x
= PyInt_FromLong(CL_FLOATING_ENUM_VALUE
);
1551 if (x
== NULL
|| PyDict_SetItemString(d
, "FLOATING_ENUM_VALUE", x
) < 0)
1555 #ifdef CL_FLOATING_RANGE_VALUE
1556 x
= PyInt_FromLong(CL_FLOATING_RANGE_VALUE
);
1557 if (x
== NULL
|| PyDict_SetItemString(d
, "FLOATING_RANGE_VALUE", x
) < 0)
1562 x
= PyInt_FromLong(CL_FORMAT
);
1563 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT", x
) < 0)
1567 #ifdef CL_FORMAT_ABGR
1568 x
= PyInt_FromLong(CL_FORMAT_ABGR
);
1569 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_ABGR", x
) < 0)
1573 #ifdef CL_FORMAT_BGR
1574 x
= PyInt_FromLong(CL_FORMAT_BGR
);
1575 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_BGR", x
) < 0)
1579 #ifdef CL_FORMAT_BGR233
1580 x
= PyInt_FromLong(CL_FORMAT_BGR233
);
1581 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_BGR233", x
) < 0)
1585 #ifdef CL_FORMAT_GRAYSCALE
1586 x
= PyInt_FromLong(CL_FORMAT_GRAYSCALE
);
1587 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_GRAYSCALE", x
) < 0)
1591 #ifdef CL_FORMAT_MONO
1592 x
= PyInt_FromLong(CL_FORMAT_MONO
);
1593 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_MONO", x
) < 0)
1597 #ifdef CL_FORMAT_RBG323
1598 x
= PyInt_FromLong(CL_FORMAT_RBG323
);
1599 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_RBG323", x
) < 0)
1603 #ifdef CL_FORMAT_STEREO_INTERLEAVED
1604 x
= PyInt_FromLong(CL_FORMAT_STEREO_INTERLEAVED
);
1605 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_STEREO_INTERLEAVED", x
) < 0)
1609 #ifdef CL_FORMAT_XBGR
1610 x
= PyInt_FromLong(CL_FORMAT_XBGR
);
1611 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_XBGR", x
) < 0)
1615 #ifdef CL_FORMAT_YCbCr
1616 x
= PyInt_FromLong(CL_FORMAT_YCbCr
);
1617 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_YCbCr", x
) < 0)
1621 #ifdef CL_FORMAT_YCbCr422
1622 x
= PyInt_FromLong(CL_FORMAT_YCbCr422
);
1623 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_YCbCr422", x
) < 0)
1627 #ifdef CL_FORMAT_YCbCr422DC
1628 x
= PyInt_FromLong(CL_FORMAT_YCbCr422DC
);
1629 if (x
== NULL
|| PyDict_SetItemString(d
, "FORMAT_YCbCr422DC", x
) < 0)
1634 x
= PyInt_FromLong(CL_FRAME
);
1635 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAME", x
) < 0)
1639 #ifdef CL_FRAMES_PER_CHUNK
1640 x
= PyInt_FromLong(CL_FRAMES_PER_CHUNK
);
1641 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAMES_PER_CHUNK", x
) < 0)
1645 #ifdef CL_FRAME_BUFFER_SIZE
1646 x
= PyInt_FromLong(CL_FRAME_BUFFER_SIZE
);
1647 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAME_BUFFER_SIZE", x
) < 0)
1651 #ifdef CL_FRAME_BUFFER_SIZE_ZERO
1652 x
= PyInt_FromLong(CL_FRAME_BUFFER_SIZE_ZERO
);
1653 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAME_BUFFER_SIZE_ZERO", x
) < 0)
1657 #ifdef CL_FRAME_INDEX
1658 x
= PyInt_FromLong(CL_FRAME_INDEX
);
1659 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAME_INDEX", x
) < 0)
1663 #ifdef CL_FRAME_RATE
1664 x
= PyInt_FromLong(CL_FRAME_RATE
);
1665 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAME_RATE", x
) < 0)
1669 #ifdef CL_FRAME_SIZE
1670 x
= PyInt_FromLong(CL_FRAME_SIZE
);
1671 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAME_SIZE", x
) < 0)
1675 #ifdef CL_FRAME_TYPE
1676 x
= PyInt_FromLong(CL_FRAME_TYPE
);
1677 if (x
== NULL
|| PyDict_SetItemString(d
, "FRAME_TYPE", x
) < 0)
1682 x
= PyInt_FromLong(CL_G711_ALAW
);
1683 if (x
== NULL
|| PyDict_SetItemString(d
, "G711_ALAW", x
) < 0)
1687 #ifdef CL_G711_ALAW_SOFTWARE
1688 x
= PyInt_FromLong(CL_G711_ALAW_SOFTWARE
);
1689 if (x
== NULL
|| PyDict_SetItemString(d
, "G711_ALAW_SOFTWARE", x
) < 0)
1694 x
= PyInt_FromLong(CL_G711_ULAW
);
1695 if (x
== NULL
|| PyDict_SetItemString(d
, "G711_ULAW", x
) < 0)
1699 #ifdef CL_G711_ULAW_SOFTWARE
1700 x
= PyInt_FromLong(CL_G711_ULAW_SOFTWARE
);
1701 if (x
== NULL
|| PyDict_SetItemString(d
, "G711_ULAW_SOFTWARE", x
) < 0)
1706 x
= PyInt_FromLong(CL_GRAYSCALE
);
1707 if (x
== NULL
|| PyDict_SetItemString(d
, "GRAYSCALE", x
) < 0)
1712 x
= PyInt_FromLong(CL_HDCC
);
1713 if (x
== NULL
|| PyDict_SetItemString(d
, "HDCC", x
) < 0)
1717 #ifdef CL_HDCC_SAMPLES_PER_TILE
1718 x
= PyInt_FromLong(CL_HDCC_SAMPLES_PER_TILE
);
1719 if (x
== NULL
|| PyDict_SetItemString(d
, "HDCC_SAMPLES_PER_TILE", x
) < 0)
1723 #ifdef CL_HDCC_SOFTWARE
1724 x
= PyInt_FromLong(CL_HDCC_SOFTWARE
);
1725 if (x
== NULL
|| PyDict_SetItemString(d
, "HDCC_SOFTWARE", x
) < 0)
1729 #ifdef CL_HDCC_TILE_THRESHOLD
1730 x
= PyInt_FromLong(CL_HDCC_TILE_THRESHOLD
);
1731 if (x
== NULL
|| PyDict_SetItemString(d
, "HDCC_TILE_THRESHOLD", x
) < 0)
1735 #ifdef CL_HEADER_START_CODE
1736 x
= PyInt_FromLong(CL_HEADER_START_CODE
);
1737 if (x
== NULL
|| PyDict_SetItemString(d
, "HEADER_START_CODE", x
) < 0)
1741 #ifdef CL_IMAGEINFO_FIELDMASK
1742 x
= PyInt_FromLong(CL_IMAGEINFO_FIELDMASK
);
1743 if (x
== NULL
|| PyDict_SetItemString(d
, "IMAGEINFO_FIELDMASK", x
) < 0)
1747 #ifdef CL_IMAGE_CROP_BOTTOM
1748 x
= PyInt_FromLong(CL_IMAGE_CROP_BOTTOM
);
1749 if (x
== NULL
|| PyDict_SetItemString(d
, "IMAGE_CROP_BOTTOM", x
) < 0)
1753 #ifdef CL_IMAGE_CROP_LEFT
1754 x
= PyInt_FromLong(CL_IMAGE_CROP_LEFT
);
1755 if (x
== NULL
|| PyDict_SetItemString(d
, "IMAGE_CROP_LEFT", x
) < 0)
1759 #ifdef CL_IMAGE_CROP_RIGHT
1760 x
= PyInt_FromLong(CL_IMAGE_CROP_RIGHT
);
1761 if (x
== NULL
|| PyDict_SetItemString(d
, "IMAGE_CROP_RIGHT", x
) < 0)
1765 #ifdef CL_IMAGE_CROP_TOP
1766 x
= PyInt_FromLong(CL_IMAGE_CROP_TOP
);
1767 if (x
== NULL
|| PyDict_SetItemString(d
, "IMAGE_CROP_TOP", x
) < 0)
1771 #ifdef CL_IMAGE_HEIGHT
1772 x
= PyInt_FromLong(CL_IMAGE_HEIGHT
);
1773 if (x
== NULL
|| PyDict_SetItemString(d
, "IMAGE_HEIGHT", x
) < 0)
1777 #ifdef CL_IMAGE_WIDTH
1778 x
= PyInt_FromLong(CL_IMAGE_WIDTH
);
1779 if (x
== NULL
|| PyDict_SetItemString(d
, "IMAGE_WIDTH", x
) < 0)
1783 #ifdef CL_IMPACT_CODEC_CONTROL
1784 x
= PyInt_FromLong(CL_IMPACT_CODEC_CONTROL
);
1785 if (x
== NULL
|| PyDict_SetItemString(d
, "IMPACT_CODEC_CONTROL", x
) < 0)
1789 #ifdef CL_IMPACT_FRAME_INTERLEAVE
1790 x
= PyInt_FromLong(CL_IMPACT_FRAME_INTERLEAVE
);
1791 if (x
== NULL
|| PyDict_SetItemString(d
, "IMPACT_FRAME_INTERLEAVE", x
) < 0)
1795 #ifdef CL_IMPACT_NUM_PARAMS
1796 x
= PyInt_FromLong(CL_IMPACT_NUM_PARAMS
);
1797 if (x
== NULL
|| PyDict_SetItemString(d
, "IMPACT_NUM_PARAMS", x
) < 0)
1801 #ifdef CL_INTERNAL_FORMAT
1802 x
= PyInt_FromLong(CL_INTERNAL_FORMAT
);
1803 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERNAL_FORMAT", x
) < 0)
1807 #ifdef CL_INTERNAL_IMAGE_HEIGHT
1808 x
= PyInt_FromLong(CL_INTERNAL_IMAGE_HEIGHT
);
1809 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERNAL_IMAGE_HEIGHT", x
) < 0)
1813 #ifdef CL_INTERNAL_IMAGE_WIDTH
1814 x
= PyInt_FromLong(CL_INTERNAL_IMAGE_WIDTH
);
1815 if (x
== NULL
|| PyDict_SetItemString(d
, "INTERNAL_IMAGE_WIDTH", x
) < 0)
1820 x
= PyInt_FromLong(CL_INTRA
);
1821 if (x
== NULL
|| PyDict_SetItemString(d
, "INTRA", x
) < 0)
1826 x
= PyInt_FromLong(CL_JPEG
);
1827 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG", x
) < 0)
1831 #ifdef CL_JPEG_COSMO
1832 x
= PyInt_FromLong(CL_JPEG_COSMO
);
1833 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_COSMO", x
) < 0)
1837 #ifdef CL_JPEG_ERROR
1838 x
= PyInt_FromLong(CL_JPEG_ERROR
);
1839 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_ERROR", x
) < 0)
1843 #ifdef CL_JPEG_IMPACT
1844 x
= PyInt_FromLong(CL_JPEG_IMPACT
);
1845 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_IMPACT", x
) < 0)
1849 #ifdef CL_JPEG_NUM_PARAMS
1850 x
= PyInt_FromLong(CL_JPEG_NUM_PARAMS
);
1851 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_NUM_PARAMS", x
) < 0)
1855 #ifdef CL_JPEG_QUALITY_FACTOR
1856 x
= PyInt_FromLong(CL_JPEG_QUALITY_FACTOR
);
1857 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_QUALITY_FACTOR", x
) < 0)
1861 #ifdef CL_JPEG_QUANTIZATION_TABLES
1862 x
= PyInt_FromLong(CL_JPEG_QUANTIZATION_TABLES
);
1863 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_QUANTIZATION_TABLES", x
) < 0)
1867 #ifdef CL_JPEG_SOFTWARE
1868 x
= PyInt_FromLong(CL_JPEG_SOFTWARE
);
1869 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_SOFTWARE", x
) < 0)
1873 #ifdef CL_JPEG_STREAM_HEADERS
1874 x
= PyInt_FromLong(CL_JPEG_STREAM_HEADERS
);
1875 if (x
== NULL
|| PyDict_SetItemString(d
, "JPEG_STREAM_HEADERS", x
) < 0)
1880 x
= PyInt_FromLong(CL_KEYFRAME
);
1881 if (x
== NULL
|| PyDict_SetItemString(d
, "KEYFRAME", x
) < 0)
1885 #ifdef CL_KEYFRAME_DISTANCE
1886 x
= PyInt_FromLong(CL_KEYFRAME_DISTANCE
);
1887 if (x
== NULL
|| PyDict_SetItemString(d
, "KEYFRAME_DISTANCE", x
) < 0)
1891 #ifdef CL_LAST_FRAME_INDEX
1892 x
= PyInt_FromLong(CL_LAST_FRAME_INDEX
);
1893 if (x
== NULL
|| PyDict_SetItemString(d
, "LAST_FRAME_INDEX", x
) < 0)
1898 x
= PyInt_FromLong(CL_LAYER
);
1899 if (x
== NULL
|| PyDict_SetItemString(d
, "LAYER", x
) < 0)
1903 #ifdef CL_LUMA_THRESHOLD
1904 x
= PyInt_FromLong(CL_LUMA_THRESHOLD
);
1905 if (x
== NULL
|| PyDict_SetItemString(d
, "LUMA_THRESHOLD", x
) < 0)
1909 #ifdef CL_MAX_NUMBER_OF_AUDIO_ALGORITHMS
1910 x
= PyInt_FromLong(CL_MAX_NUMBER_OF_AUDIO_ALGORITHMS
);
1911 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_NUMBER_OF_AUDIO_ALGORITHMS", x
) < 0)
1915 #ifdef CL_MAX_NUMBER_OF_FORMATS
1916 x
= PyInt_FromLong(CL_MAX_NUMBER_OF_FORMATS
);
1917 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_NUMBER_OF_FORMATS", x
) < 0)
1921 #ifdef CL_MAX_NUMBER_OF_ORIGINAL_FORMATS
1922 x
= PyInt_FromLong(CL_MAX_NUMBER_OF_ORIGINAL_FORMATS
);
1923 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_NUMBER_OF_ORIGINAL_FORMATS", x
) < 0)
1927 #ifdef CL_MAX_NUMBER_OF_PARAMS
1928 x
= PyInt_FromLong(CL_MAX_NUMBER_OF_PARAMS
);
1929 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_NUMBER_OF_PARAMS", x
) < 0)
1933 #ifdef CL_MAX_NUMBER_OF_VIDEO_ALGORITHMS
1934 x
= PyInt_FromLong(CL_MAX_NUMBER_OF_VIDEO_ALGORITHMS
);
1935 if (x
== NULL
|| PyDict_SetItemString(d
, "MAX_NUMBER_OF_VIDEO_ALGORITHMS", x
) < 0)
1940 x
= PyInt_FromLong(CL_MONO
);
1941 if (x
== NULL
|| PyDict_SetItemString(d
, "MONO", x
) < 0)
1945 #ifdef CL_MPEG1_AUDIO_AWARE
1946 x
= PyInt_FromLong(CL_MPEG1_AUDIO_AWARE
);
1947 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_AWARE", x
) < 0)
1951 #ifdef CL_MPEG1_AUDIO_LAYER
1952 x
= PyInt_FromLong(CL_MPEG1_AUDIO_LAYER
);
1953 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_LAYER", x
) < 0)
1957 #ifdef CL_MPEG1_AUDIO_LAYER_I
1958 x
= PyInt_FromLong(CL_MPEG1_AUDIO_LAYER_I
);
1959 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_LAYER_I", x
) < 0)
1963 #ifdef CL_MPEG1_AUDIO_LAYER_II
1964 x
= PyInt_FromLong(CL_MPEG1_AUDIO_LAYER_II
);
1965 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_LAYER_II", x
) < 0)
1969 #ifdef CL_MPEG1_AUDIO_MODE
1970 x
= PyInt_FromLong(CL_MPEG1_AUDIO_MODE
);
1971 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_MODE", x
) < 0)
1975 #ifdef CL_MPEG1_AUDIO_MODE_DUAL
1976 x
= PyInt_FromLong(CL_MPEG1_AUDIO_MODE_DUAL
);
1977 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_MODE_DUAL", x
) < 0)
1981 #ifdef CL_MPEG1_AUDIO_MODE_JOINT
1982 x
= PyInt_FromLong(CL_MPEG1_AUDIO_MODE_JOINT
);
1983 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_MODE_JOINT", x
) < 0)
1987 #ifdef CL_MPEG1_AUDIO_MODE_SINGLE
1988 x
= PyInt_FromLong(CL_MPEG1_AUDIO_MODE_SINGLE
);
1989 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_MODE_SINGLE", x
) < 0)
1993 #ifdef CL_MPEG1_AUDIO_MODE_STEREO
1994 x
= PyInt_FromLong(CL_MPEG1_AUDIO_MODE_STEREO
);
1995 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_MODE_STEREO", x
) < 0)
1999 #ifdef CL_MPEG1_AUDIO_SOFTWARE
2000 x
= PyInt_FromLong(CL_MPEG1_AUDIO_SOFTWARE
);
2001 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_AUDIO_SOFTWARE", x
) < 0)
2005 #ifdef CL_MPEG1_END_OF_STREAM
2006 x
= PyInt_FromLong(CL_MPEG1_END_OF_STREAM
);
2007 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_END_OF_STREAM", x
) < 0)
2011 #ifdef CL_MPEG1_ERROR
2012 x
= PyInt_FromLong(CL_MPEG1_ERROR
);
2013 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_ERROR", x
) < 0)
2017 #ifdef CL_MPEG1_NUM_PARAMS
2018 x
= PyInt_FromLong(CL_MPEG1_NUM_PARAMS
);
2019 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_NUM_PARAMS", x
) < 0)
2023 #ifdef CL_MPEG1_VIDEO_M
2024 x
= PyInt_FromLong(CL_MPEG1_VIDEO_M
);
2025 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_M", x
) < 0)
2029 #ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_X
2030 x
= PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_X
);
2031 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_X", x
) < 0)
2035 #ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_Y
2036 x
= PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_Y
);
2037 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_B_Y", x
) < 0)
2041 #ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_X
2042 x
= PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_X
);
2043 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_X", x
) < 0)
2047 #ifdef CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_Y
2048 x
= PyInt_FromLong(CL_MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_Y
);
2049 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_MAX_MOTION_VECTOR_LENGTH_P_Y", x
) < 0)
2053 #ifdef CL_MPEG1_VIDEO_N
2054 x
= PyInt_FromLong(CL_MPEG1_VIDEO_N
);
2055 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_N", x
) < 0)
2059 #ifdef CL_MPEG1_VIDEO_SOFTNESS
2060 x
= PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS
);
2061 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_SOFTNESS", x
) < 0)
2065 #ifdef CL_MPEG1_VIDEO_SOFTNESS_MAXIMUM
2066 x
= PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS_MAXIMUM
);
2067 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_SOFTNESS_MAXIMUM", x
) < 0)
2071 #ifdef CL_MPEG1_VIDEO_SOFTNESS_MEDIUM
2072 x
= PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS_MEDIUM
);
2073 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_SOFTNESS_MEDIUM", x
) < 0)
2077 #ifdef CL_MPEG1_VIDEO_SOFTNESS_NONE
2078 x
= PyInt_FromLong(CL_MPEG1_VIDEO_SOFTNESS_NONE
);
2079 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_SOFTNESS_NONE", x
) < 0)
2083 #ifdef CL_MPEG1_VIDEO_SOFTWARE
2084 x
= PyInt_FromLong(CL_MPEG1_VIDEO_SOFTWARE
);
2085 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG1_VIDEO_SOFTWARE", x
) < 0)
2089 #ifdef CL_MPEG_VIDEO
2090 x
= PyInt_FromLong(CL_MPEG_VIDEO
);
2091 if (x
== NULL
|| PyDict_SetItemString(d
, "MPEG_VIDEO", x
) < 0)
2095 #ifdef CL_MULTIRATE_AWARE
2096 x
= PyInt_FromLong(CL_MULTIRATE_AWARE
);
2097 if (x
== NULL
|| PyDict_SetItemString(d
, "MULTIRATE_AWARE", x
) < 0)
2102 x
= PyInt_FromLong(CL_MVC1
);
2103 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC1", x
) < 0)
2107 #ifdef CL_MVC1_SOFTWARE
2108 x
= PyInt_FromLong(CL_MVC1_SOFTWARE
);
2109 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC1_SOFTWARE", x
) < 0)
2114 x
= PyInt_FromLong(CL_MVC2
);
2115 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2", x
) < 0)
2119 #ifdef CL_MVC2_BLENDING
2120 x
= PyInt_FromLong(CL_MVC2_BLENDING
);
2121 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_BLENDING", x
) < 0)
2125 #ifdef CL_MVC2_BLENDING_OFF
2126 x
= PyInt_FromLong(CL_MVC2_BLENDING_OFF
);
2127 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_BLENDING_OFF", x
) < 0)
2131 #ifdef CL_MVC2_BLENDING_ON
2132 x
= PyInt_FromLong(CL_MVC2_BLENDING_ON
);
2133 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_BLENDING_ON", x
) < 0)
2137 #ifdef CL_MVC2_CHROMA_THRESHOLD
2138 x
= PyInt_FromLong(CL_MVC2_CHROMA_THRESHOLD
);
2139 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_CHROMA_THRESHOLD", x
) < 0)
2143 #ifdef CL_MVC2_EDGE_THRESHOLD
2144 x
= PyInt_FromLong(CL_MVC2_EDGE_THRESHOLD
);
2145 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_EDGE_THRESHOLD", x
) < 0)
2149 #ifdef CL_MVC2_ERROR
2150 x
= PyInt_FromLong(CL_MVC2_ERROR
);
2151 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_ERROR", x
) < 0)
2155 #ifdef CL_MVC2_LUMA_THRESHOLD
2156 x
= PyInt_FromLong(CL_MVC2_LUMA_THRESHOLD
);
2157 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_LUMA_THRESHOLD", x
) < 0)
2161 #ifdef CL_MVC2_SOFTWARE
2162 x
= PyInt_FromLong(CL_MVC2_SOFTWARE
);
2163 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC2_SOFTWARE", x
) < 0)
2167 #ifdef CL_MVC3_QUALITY_LEVEL
2168 x
= PyInt_FromLong(CL_MVC3_QUALITY_LEVEL
);
2169 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC3_QUALITY_LEVEL", x
) < 0)
2173 #ifdef CL_MVC3_SOFTWARE
2174 x
= PyInt_FromLong(CL_MVC3_SOFTWARE
);
2175 if (x
== NULL
|| PyDict_SetItemString(d
, "MVC3_SOFTWARE", x
) < 0)
2179 #ifdef CL_NEXT_NOT_AVAILABLE
2180 x
= PyInt_FromLong(CL_NEXT_NOT_AVAILABLE
);
2181 if (x
== NULL
|| PyDict_SetItemString(d
, "NEXT_NOT_AVAILABLE", x
) < 0)
2185 #ifdef CL_NOISE_MARGIN
2186 x
= PyInt_FromLong(CL_NOISE_MARGIN
);
2187 if (x
== NULL
|| PyDict_SetItemString(d
, "NOISE_MARGIN", x
) < 0)
2192 x
= PyInt_FromLong(CL_NONE
);
2193 if (x
== NULL
|| PyDict_SetItemString(d
, "NONE", x
) < 0)
2197 #ifdef CL_NUMBER_OF_FORMATS
2198 x
= PyInt_FromLong(CL_NUMBER_OF_FORMATS
);
2199 if (x
== NULL
|| PyDict_SetItemString(d
, "NUMBER_OF_FORMATS", x
) < 0)
2203 #ifdef CL_NUMBER_OF_FRAMES
2204 x
= PyInt_FromLong(CL_NUMBER_OF_FRAMES
);
2205 if (x
== NULL
|| PyDict_SetItemString(d
, "NUMBER_OF_FRAMES", x
) < 0)
2209 #ifdef CL_NUMBER_OF_PARAMS
2210 x
= PyInt_FromLong(CL_NUMBER_OF_PARAMS
);
2211 if (x
== NULL
|| PyDict_SetItemString(d
, "NUMBER_OF_PARAMS", x
) < 0)
2215 #ifdef CL_NUMBER_OF_PARAMS_FREEZE
2216 x
= PyInt_FromLong(CL_NUMBER_OF_PARAMS_FREEZE
);
2217 if (x
== NULL
|| PyDict_SetItemString(d
, "NUMBER_OF_PARAMS_FREEZE", x
) < 0)
2221 #ifdef CL_NUMBER_OF_VIDEO_FORMATS
2222 x
= PyInt_FromLong(CL_NUMBER_OF_VIDEO_FORMATS
);
2223 if (x
== NULL
|| PyDict_SetItemString(d
, "NUMBER_OF_VIDEO_FORMATS", x
) < 0)
2227 #ifdef CL_ORIENTATION
2228 x
= PyInt_FromLong(CL_ORIENTATION
);
2229 if (x
== NULL
|| PyDict_SetItemString(d
, "ORIENTATION", x
) < 0)
2233 #ifdef CL_ORIGINAL_FORMAT
2234 x
= PyInt_FromLong(CL_ORIGINAL_FORMAT
);
2235 if (x
== NULL
|| PyDict_SetItemString(d
, "ORIGINAL_FORMAT", x
) < 0)
2239 #ifdef CL_PARAM_OUT_OF_RANGE
2240 x
= PyInt_FromLong(CL_PARAM_OUT_OF_RANGE
);
2241 if (x
== NULL
|| PyDict_SetItemString(d
, "PARAM_OUT_OF_RANGE", x
) < 0)
2245 #ifdef CL_PIXEL_ASPECT
2246 x
= PyInt_FromLong(CL_PIXEL_ASPECT
);
2247 if (x
== NULL
|| PyDict_SetItemString(d
, "PIXEL_ASPECT", x
) < 0)
2252 x
= PyInt_FromLong(CL_PREDICTED
);
2253 if (x
== NULL
|| PyDict_SetItemString(d
, "PREDICTED", x
) < 0)
2258 x
= PyInt_FromLong(CL_PREROLL
);
2259 if (x
== NULL
|| PyDict_SetItemString(d
, "PREROLL", x
) < 0)
2263 #ifdef CL_QUALITY_FACTOR
2264 x
= PyInt_FromLong(CL_QUALITY_FACTOR
);
2265 if (x
== NULL
|| PyDict_SetItemString(d
, "QUALITY_FACTOR", x
) < 0)
2269 #ifdef CL_QUALITY_LEVEL
2270 x
= PyInt_FromLong(CL_QUALITY_LEVEL
);
2271 if (x
== NULL
|| PyDict_SetItemString(d
, "QUALITY_LEVEL", x
) < 0)
2275 #ifdef CL_QUALITY_SPATIAL
2276 x
= PyInt_FromLong(CL_QUALITY_SPATIAL
);
2277 if (x
== NULL
|| PyDict_SetItemString(d
, "QUALITY_SPATIAL", x
) < 0)
2281 #ifdef CL_QUALITY_TEMPORAL
2282 x
= PyInt_FromLong(CL_QUALITY_TEMPORAL
);
2283 if (x
== NULL
|| PyDict_SetItemString(d
, "QUALITY_TEMPORAL", x
) < 0)
2287 #ifdef CL_QUANTIZATION_TABLES
2288 x
= PyInt_FromLong(CL_QUANTIZATION_TABLES
);
2289 if (x
== NULL
|| PyDict_SetItemString(d
, "QUANTIZATION_TABLES", x
) < 0)
2293 #ifdef CL_RANGE_VALUE
2294 x
= PyInt_FromLong(CL_RANGE_VALUE
);
2295 if (x
== NULL
|| PyDict_SetItemString(d
, "RANGE_VALUE", x
) < 0)
2300 x
= PyInt_FromLong(CL_RGB
);
2301 if (x
== NULL
|| PyDict_SetItemString(d
, "RGB", x
) < 0)
2306 x
= PyInt_FromLong(CL_RGB332
);
2307 if (x
== NULL
|| PyDict_SetItemString(d
, "RGB332", x
) < 0)
2312 x
= PyInt_FromLong(CL_RGB8
);
2313 if (x
== NULL
|| PyDict_SetItemString(d
, "RGB8", x
) < 0)
2318 x
= PyInt_FromLong(CL_RGBA
);
2319 if (x
== NULL
|| PyDict_SetItemString(d
, "RGBA", x
) < 0)
2324 x
= PyInt_FromLong(CL_RGBX
);
2325 if (x
== NULL
|| PyDict_SetItemString(d
, "RGBX", x
) < 0)
2330 x
= PyInt_FromLong(CL_RLE
);
2331 if (x
== NULL
|| PyDict_SetItemString(d
, "RLE", x
) < 0)
2336 x
= PyInt_FromLong(CL_RLE24
);
2337 if (x
== NULL
|| PyDict_SetItemString(d
, "RLE24", x
) < 0)
2341 #ifdef CL_RLE24_SOFTWARE
2342 x
= PyInt_FromLong(CL_RLE24_SOFTWARE
);
2343 if (x
== NULL
|| PyDict_SetItemString(d
, "RLE24_SOFTWARE", x
) < 0)
2347 #ifdef CL_RLE_SOFTWARE
2348 x
= PyInt_FromLong(CL_RLE_SOFTWARE
);
2349 if (x
== NULL
|| PyDict_SetItemString(d
, "RLE_SOFTWARE", x
) < 0)
2354 x
= PyInt_FromLong(CL_RTR
);
2355 if (x
== NULL
|| PyDict_SetItemString(d
, "RTR", x
) < 0)
2360 x
= PyInt_FromLong(CL_RTR1
);
2361 if (x
== NULL
|| PyDict_SetItemString(d
, "RTR1", x
) < 0)
2365 #ifdef CL_RTR_QUALITY_LEVEL
2366 x
= PyInt_FromLong(CL_RTR_QUALITY_LEVEL
);
2367 if (x
== NULL
|| PyDict_SetItemString(d
, "RTR_QUALITY_LEVEL", x
) < 0)
2371 #ifdef CL_SAMPLES_PER_TILE
2372 x
= PyInt_FromLong(CL_SAMPLES_PER_TILE
);
2373 if (x
== NULL
|| PyDict_SetItemString(d
, "SAMPLES_PER_TILE", x
) < 0)
2377 #ifdef CL_SCHEME_BUSY
2378 x
= PyInt_FromLong(CL_SCHEME_BUSY
);
2379 if (x
== NULL
|| PyDict_SetItemString(d
, "SCHEME_BUSY", x
) < 0)
2383 #ifdef CL_SCHEME_NOT_AVAILABLE
2384 x
= PyInt_FromLong(CL_SCHEME_NOT_AVAILABLE
);
2385 if (x
== NULL
|| PyDict_SetItemString(d
, "SCHEME_NOT_AVAILABLE", x
) < 0)
2390 x
= PyInt_FromLong(CL_SPEED
);
2391 if (x
== NULL
|| PyDict_SetItemString(d
, "SPEED", x
) < 0)
2395 #ifdef CL_STEREO_INTERLEAVED
2396 x
= PyInt_FromLong(CL_STEREO_INTERLEAVED
);
2397 if (x
== NULL
|| PyDict_SetItemString(d
, "STEREO_INTERLEAVED", x
) < 0)
2401 #ifdef CL_STREAM_HEADERS
2402 x
= PyInt_FromLong(CL_STREAM_HEADERS
);
2403 if (x
== NULL
|| PyDict_SetItemString(d
, "STREAM_HEADERS", x
) < 0)
2407 #ifdef CL_TILE_THRESHOLD
2408 x
= PyInt_FromLong(CL_TILE_THRESHOLD
);
2409 if (x
== NULL
|| PyDict_SetItemString(d
, "TILE_THRESHOLD", x
) < 0)
2414 x
= PyInt_FromLong(CL_TOP_DOWN
);
2415 if (x
== NULL
|| PyDict_SetItemString(d
, "TOP_DOWN", x
) < 0)
2420 x
= PyInt_FromLong(CL_ULAW
);
2421 if (x
== NULL
|| PyDict_SetItemString(d
, "ULAW", x
) < 0)
2425 #ifdef CL_UNCOMPRESSED
2426 x
= PyInt_FromLong(CL_UNCOMPRESSED
);
2427 if (x
== NULL
|| PyDict_SetItemString(d
, "UNCOMPRESSED", x
) < 0)
2431 #ifdef CL_UNCOMPRESSED_AUDIO
2432 x
= PyInt_FromLong(CL_UNCOMPRESSED_AUDIO
);
2433 if (x
== NULL
|| PyDict_SetItemString(d
, "UNCOMPRESSED_AUDIO", x
) < 0)
2437 #ifdef CL_UNCOMPRESSED_VIDEO
2438 x
= PyInt_FromLong(CL_UNCOMPRESSED_VIDEO
);
2439 if (x
== NULL
|| PyDict_SetItemString(d
, "UNCOMPRESSED_VIDEO", x
) < 0)
2443 #ifdef CL_UNKNOWN_SCHEME
2444 x
= PyInt_FromLong(CL_UNKNOWN_SCHEME
);
2445 if (x
== NULL
|| PyDict_SetItemString(d
, "UNKNOWN_SCHEME", x
) < 0)
2450 x
= PyInt_FromLong(CL_VIDEO
);
2451 if (x
== NULL
|| PyDict_SetItemString(d
, "VIDEO", x
) < 0)
2456 x
= PyInt_FromLong(CL_Y
);
2457 if (x
== NULL
|| PyDict_SetItemString(d
, "Y", x
) < 0)
2462 x
= PyInt_FromLong(CL_YCbCr
);
2463 if (x
== NULL
|| PyDict_SetItemString(d
, "YCbCr", x
) < 0)
2468 x
= PyInt_FromLong(CL_YCbCr422
);
2469 if (x
== NULL
|| PyDict_SetItemString(d
, "YCbCr422", x
) < 0)
2473 #ifdef CL_YCbCr422DC
2474 x
= PyInt_FromLong(CL_YCbCr422DC
);
2475 if (x
== NULL
|| PyDict_SetItemString(d
, "YCbCr422DC", x
) < 0)
2479 #ifdef CL_YCbCr422HC
2480 x
= PyInt_FromLong(CL_YCbCr422HC
);
2481 if (x
== NULL
|| PyDict_SetItemString(d
, "YCbCr422HC", x
) < 0)
2486 x
= PyInt_FromLong(CL_YUV
);
2487 if (x
== NULL
|| PyDict_SetItemString(d
, "YUV", x
) < 0)
2492 x
= PyInt_FromLong(CL_YUV422
);
2493 if (x
== NULL
|| PyDict_SetItemString(d
, "YUV422", x
) < 0)
2498 x
= PyInt_FromLong(CL_YUV422DC
);
2499 if (x
== NULL
|| PyDict_SetItemString(d
, "YUV422DC", x
) < 0)
2504 x
= PyInt_FromLong(CL_YUV422HC
);
2505 if (x
== NULL
|| PyDict_SetItemString(d
, "YUV422HC", x
) < 0)
2510 x
= PyInt_FromLong(AWCMP_STEREO
);
2511 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_STEREO", x
) < 0)
2515 #ifdef AWCMP_JOINT_STEREO
2516 x
= PyInt_FromLong(AWCMP_JOINT_STEREO
);
2517 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_JOINT_STEREO", x
) < 0)
2521 #ifdef AWCMP_INDEPENDENT
2522 x
= PyInt_FromLong(AWCMP_INDEPENDENT
);
2523 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_INDEPENDENT", x
) < 0)
2527 #ifdef AWCMP_FIXED_RATE
2528 x
= PyInt_FromLong(AWCMP_FIXED_RATE
);
2529 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_FIXED_RATE", x
) < 0)
2533 #ifdef AWCMP_CONST_QUAL
2534 x
= PyInt_FromLong(AWCMP_CONST_QUAL
);
2535 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_CONST_QUAL", x
) < 0)
2539 #ifdef AWCMP_LOSSLESS
2540 x
= PyInt_FromLong(AWCMP_LOSSLESS
);
2541 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_LOSSLESS", x
) < 0)
2545 #ifdef AWCMP_MPEG_LAYER_I
2546 x
= PyInt_FromLong(AWCMP_MPEG_LAYER_I
);
2547 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_MPEG_LAYER_I", x
) < 0)
2551 #ifdef AWCMP_MPEG_LAYER_II
2552 x
= PyInt_FromLong(AWCMP_MPEG_LAYER_II
);
2553 if (x
== NULL
|| PyDict_SetItemString(d
, "AWCMP_MPEG_LAYER_II", x
) < 0)
2558 (void) clSetErrorHandler(cl_ErrorHandler
);