Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e474fb36
Kaydet (Commit)
e474fb36
authored
Ock 17, 1997
tarafından
Roger E. Masse
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Renamed.
üst
5c7e711b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
584 additions
and
530 deletions
+584
-530
clmodule.c
Modules/clmodule.c
+584
-530
No files found.
Modules/clmodule.c
Dosyayı görüntüle @
e474fb36
...
@@ -36,19 +36,17 @@ PERFORMANCE OF THIS SOFTWARE.
...
@@ -36,19 +36,17 @@ PERFORMANCE OF THIS SOFTWARE.
#include <stdarg.h>
#include <stdarg.h>
#include <cl.h>
#include <cl.h>
#include "allobjects.h"
#include "Python.h"
#include "modsupport.h"
/* For getargs() etc. */
#include "ceval.h"
/* For call_object() */
typedef
struct
{
typedef
struct
{
OB
_HEAD
PyObject
_HEAD
int
ob_isCompressor
;
/* Compressor or Decompressor */
int
ob_isCompressor
;
/* Compressor or Decompressor */
CL_Handle
ob_compressorHdl
;
CL_Handle
ob_compressorHdl
;
int
*
ob_paramtypes
;
int
*
ob_paramtypes
;
int
ob_nparams
;
int
ob_nparams
;
}
clobject
;
}
clobject
;
static
o
bject
*
ClError
;
/* exception cl.error */
static
PyO
bject
*
ClError
;
/* exception cl.error */
static
int
error_handler_called
=
0
;
static
int
error_handler_called
=
0
;
...
@@ -71,7 +69,7 @@ cl_ErrorHandler(CL_Handle handle, int code, const char *fmt, ...)
...
@@ -71,7 +69,7 @@ cl_ErrorHandler(CL_Handle handle, int code, const char *fmt, ...)
char
errbuf
[
BUFSIZ
];
/* hopefully big enough */
char
errbuf
[
BUFSIZ
];
/* hopefully big enough */
char
*
p
;
char
*
p
;
if
(
err_o
ccurred
())
/* don't change existing error */
if
(
PyErr_O
ccurred
())
/* don't change existing error */
return
;
return
;
error_handler_called
=
1
;
error_handler_called
=
1
;
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
...
@@ -80,7 +78,7 @@ cl_ErrorHandler(CL_Handle handle, int code, const char *fmt, ...)
...
@@ -80,7 +78,7 @@ cl_ErrorHandler(CL_Handle handle, int code, const char *fmt, ...)
p
=
&
errbuf
[
strlen
(
errbuf
)
-
1
];
/* swat the line feed */
p
=
&
errbuf
[
strlen
(
errbuf
)
-
1
];
/* swat the line feed */
if
(
*
p
==
'\n'
)
if
(
*
p
==
'\n'
)
*
p
=
0
;
*
p
=
0
;
err_setstr
(
ClError
,
errbuf
);
PyErr_SetString
(
ClError
,
errbuf
);
}
}
/*
/*
...
@@ -97,14 +95,15 @@ param_type_is_float(clobject *self, int param)
...
@@ -97,14 +95,15 @@ param_type_is_float(clobject *self, int param)
if
(
error_handler_called
)
if
(
error_handler_called
)
return
-
1
;
return
-
1
;
self
->
ob_paramtypes
=
NEW
(
int
,
bufferlength
);
self
->
ob_paramtypes
=
PyMem_
NEW
(
int
,
bufferlength
);
if
(
self
->
ob_paramtypes
==
NULL
)
if
(
self
->
ob_paramtypes
==
NULL
)
return
-
1
;
return
-
1
;
self
->
ob_nparams
=
bufferlength
/
2
;
self
->
ob_nparams
=
bufferlength
/
2
;
(
void
)
clQueryParams
(
self
->
ob_compressorHdl
,
self
->
ob_paramtypes
,
bufferlength
);
(
void
)
clQueryParams
(
self
->
ob_compressorHdl
,
self
->
ob_paramtypes
,
bufferlength
);
if
(
error_handler_called
)
{
if
(
error_handler_called
)
{
DEL
(
self
->
ob_paramtypes
);
PyMem_
DEL
(
self
->
ob_paramtypes
);
self
->
ob_paramtypes
=
NULL
;
self
->
ob_paramtypes
=
NULL
;
return
-
1
;
return
-
1
;
}
}
...
@@ -123,22 +122,23 @@ param_type_is_float(clobject *self, int param)
...
@@ -123,22 +122,23 @@ param_type_is_float(clobject *self, int param)
/********************************************************************
/********************************************************************
Single image compression/decompression.
Single image compression/decompression.
********************************************************************/
********************************************************************/
static
o
bject
*
static
PyO
bject
*
cl_CompressImage
(
object
*
self
,
o
bject
*
args
)
cl_CompressImage
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
compressionScheme
,
width
,
height
,
originalFormat
;
int
compressionScheme
,
width
,
height
,
originalFormat
;
float
compressionRatio
;
float
compressionRatio
;
int
frameBufferSize
,
compressedBufferSize
;
int
frameBufferSize
,
compressedBufferSize
;
char
*
frameBuffer
;
char
*
frameBuffer
;
o
bject
*
compressedBuffer
;
PyO
bject
*
compressedBuffer
;
if
(
!
getargs
(
args
,
"(iiiifs#)"
,
&
compressionScheme
,
&
width
,
&
height
,
if
(
!
PyArg_Parse
(
args
,
"(iiiifs#)"
,
&
compressionScheme
,
&
originalFormat
,
&
compressionRatio
,
&
frameBuffer
,
&
width
,
&
height
,
&
frameBufferSize
))
&
originalFormat
,
&
compressionRatio
,
&
frameBuffer
,
&
frameBufferSize
))
return
NULL
;
return
NULL
;
retry:
retry:
compressedBuffer
=
newsizedstringobject
(
NULL
,
frameBufferSize
);
compressedBuffer
=
PyString_FromStringAndSize
(
NULL
,
frameBufferSize
);
if
(
compressedBuffer
==
NULL
)
if
(
compressedBuffer
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -147,53 +147,54 @@ cl_CompressImage(object *self, object *args)
...
@@ -147,53 +147,54 @@ cl_CompressImage(object *self, object *args)
if
(
clCompressImage
(
compressionScheme
,
width
,
height
,
originalFormat
,
if
(
clCompressImage
(
compressionScheme
,
width
,
height
,
originalFormat
,
compressionRatio
,
(
void
*
)
frameBuffer
,
compressionRatio
,
(
void
*
)
frameBuffer
,
&
compressedBufferSize
,
&
compressedBufferSize
,
(
void
*
)
getstringvalue
(
compressedBuffer
))
(
void
*
)
PyString_AsString
(
compressedBuffer
))
==
FAILURE
)
{
==
FAILURE
)
{
DECREF
(
compressedBuffer
);
Py_
DECREF
(
compressedBuffer
);
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"clCompressImage failed"
);
PyErr_SetString
(
ClError
,
"clCompressImage failed"
);
return
NULL
;
return
NULL
;
}
}
if
(
compressedBufferSize
>
frameBufferSize
)
{
if
(
compressedBufferSize
>
frameBufferSize
)
{
frameBufferSize
=
compressedBufferSize
;
frameBufferSize
=
compressedBufferSize
;
DECREF
(
compressedBuffer
);
Py_
DECREF
(
compressedBuffer
);
goto
retry
;
goto
retry
;
}
}
if
(
compressedBufferSize
<
frameBufferSize
)
if
(
compressedBufferSize
<
frameBufferSize
)
if
(
resizestring
(
&
compressedBuffer
,
compressedBufferSize
))
if
(
_PyString_Resize
(
&
compressedBuffer
,
compressedBufferSize
))
return
NULL
;
return
NULL
;
return
compressedBuffer
;
return
compressedBuffer
;
}
}
static
o
bject
*
static
PyO
bject
*
cl_DecompressImage
(
object
*
self
,
o
bject
*
args
)
cl_DecompressImage
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
compressionScheme
,
width
,
height
,
originalFormat
;
int
compressionScheme
,
width
,
height
,
originalFormat
;
char
*
compressedBuffer
;
char
*
compressedBuffer
;
int
compressedBufferSize
,
frameBufferSize
;
int
compressedBufferSize
,
frameBufferSize
;
o
bject
*
frameBuffer
;
PyO
bject
*
frameBuffer
;
if
(
!
getargs
(
args
,
"(iiiis#)"
,
&
compressionScheme
,
&
width
,
&
height
,
if
(
!
PyArg_Parse
(
args
,
"(iiiis#)"
,
&
compressionScheme
,
&
width
,
&
height
,
&
originalFormat
,
&
compressedBuffer
,
&
originalFormat
,
&
compressedBuffer
,
&
compressedBufferSize
))
&
compressedBufferSize
))
return
NULL
;
return
NULL
;
frameBufferSize
=
width
*
height
*
CL_BytesPerPixel
(
originalFormat
);
frameBufferSize
=
width
*
height
*
CL_BytesPerPixel
(
originalFormat
);
frameBuffer
=
newsizedstringobject
(
NULL
,
frameBufferSize
);
frameBuffer
=
PyString_FromStringAndSize
(
NULL
,
frameBufferSize
);
if
(
frameBuffer
==
NULL
)
if
(
frameBuffer
==
NULL
)
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
if
(
clDecompressImage
(
compressionScheme
,
width
,
height
,
originalFormat
,
if
(
clDecompressImage
(
compressionScheme
,
width
,
height
,
originalFormat
,
compressedBufferSize
,
compressedBuffer
,
compressedBufferSize
,
compressedBuffer
,
(
void
*
)
getstringvalue
(
frameBuffer
))
==
FAILURE
)
{
(
void
*
)
PyString_AsString
(
frameBuffer
))
DECREF
(
frameBuffer
);
==
FAILURE
)
{
Py_DECREF
(
frameBuffer
);
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"clDecompressImage failed"
);
PyErr_SetString
(
ClError
,
"clDecompressImage failed"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -204,58 +205,59 @@ cl_DecompressImage(object *self, object *args)
...
@@ -204,58 +205,59 @@ cl_DecompressImage(object *self, object *args)
Sequential compression/decompression.
Sequential compression/decompression.
********************************************************************/
********************************************************************/
#define CheckCompressor(self) if ((self)->ob_compressorHdl == NULL) { \
#define CheckCompressor(self) if ((self)->ob_compressorHdl == NULL) { \
err_setstr(
RuntimeError, "(de)compressor not active"); \
PyErr_SetString(PyExc_
RuntimeError, "(de)compressor not active"); \
return NULL; \
return NULL; \
}
}
static
o
bject
*
static
PyO
bject
*
doClose
(
clobject
*
self
,
o
bject
*
args
,
int
(
*
close_func
)(
CL_Handle
))
doClose
(
clobject
*
self
,
PyO
bject
*
args
,
int
(
*
close_func
)(
CL_Handle
))
{
{
CheckCompressor
(
self
);
CheckCompressor
(
self
);
if
(
!
getnoarg
(
args
))
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
if
((
*
close_func
)(
self
->
ob_compressorHdl
)
==
FAILURE
)
{
if
((
*
close_func
)(
self
->
ob_compressorHdl
)
==
FAILURE
)
{
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"close failed"
);
PyErr_SetString
(
ClError
,
"close failed"
);
return
NULL
;
return
NULL
;
}
}
self
->
ob_compressorHdl
=
NULL
;
self
->
ob_compressorHdl
=
NULL
;
if
(
self
->
ob_paramtypes
)
if
(
self
->
ob_paramtypes
)
DEL
(
self
->
ob_paramtypes
);
PyMem_
DEL
(
self
->
ob_paramtypes
);
self
->
ob_paramtypes
=
NULL
;
self
->
ob_paramtypes
=
NULL
;
INCREF
(
None
);
Py_INCREF
(
Py_
None
);
return
None
;
return
Py_
None
;
}
}
static
o
bject
*
static
PyO
bject
*
clm_CloseCompressor
(
object
*
self
,
o
bject
*
args
)
clm_CloseCompressor
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
doClose
(
SELF
,
args
,
clCloseCompressor
);
return
doClose
(
SELF
,
args
,
clCloseCompressor
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_CloseDecompressor
(
object
*
self
,
o
bject
*
args
)
clm_CloseDecompressor
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
doClose
(
SELF
,
args
,
clCloseDecompressor
);
return
doClose
(
SELF
,
args
,
clCloseDecompressor
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_Compress
(
object
*
self
,
o
bject
*
args
)
clm_Compress
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
numberOfFrames
;
int
numberOfFrames
;
int
frameBufferSize
,
compressedBufferSize
,
size
;
int
frameBufferSize
,
compressedBufferSize
,
size
;
char
*
frameBuffer
;
char
*
frameBuffer
;
o
bject
*
data
;
PyO
bject
*
data
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getargs
(
args
,
"(is#)"
,
&
numberOfFrames
,
&
frameBuffer
,
&
frameBufferSize
))
if
(
!
PyArg_Parse
(
args
,
"(is#)"
,
&
numberOfFrames
,
&
frameBuffer
,
&
frameBufferSize
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
...
@@ -264,46 +266,47 @@ clm_Compress(object *self, object *args)
...
@@ -264,46 +266,47 @@ clm_Compress(object *self, object *args)
if
(
error_handler_called
)
if
(
error_handler_called
)
return
NULL
;
return
NULL
;
data
=
newsizedstringobject
(
NULL
,
size
);
data
=
PyString_FromStringAndSize
(
NULL
,
size
);
if
(
data
==
NULL
)
if
(
data
==
NULL
)
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
if
(
clCompress
(
SELF
->
ob_compressorHdl
,
numberOfFrames
,
if
(
clCompress
(
SELF
->
ob_compressorHdl
,
numberOfFrames
,
(
void
*
)
frameBuffer
,
&
compressedBufferSize
,
(
void
*
)
frameBuffer
,
&
compressedBufferSize
,
(
void
*
)
getstringvalue
(
data
))
==
FAILURE
)
{
(
void
*
)
PyString_AsString
(
data
))
==
FAILURE
)
{
DECREF
(
data
);
Py_
DECREF
(
data
);
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"compress failed"
);
PyErr_SetString
(
ClError
,
"compress failed"
);
return
NULL
;
return
NULL
;
}
}
if
(
compressedBufferSize
<
size
)
if
(
compressedBufferSize
<
size
)
if
(
resizestring
(
&
data
,
compressedBufferSize
))
if
(
_PyString_Resize
(
&
data
,
compressedBufferSize
))
return
NULL
;
return
NULL
;
if
(
compressedBufferSize
>
size
)
{
if
(
compressedBufferSize
>
size
)
{
/* we didn't get all "compressed" data */
/* we didn't get all "compressed" data */
DECREF
(
data
);
Py_DECREF
(
data
);
err_setstr
(
ClError
,
"compressed data is more than fitted"
);
PyErr_SetString
(
ClError
,
"compressed data is more than fitted"
);
return
NULL
;
return
NULL
;
}
}
return
data
;
return
data
;
}
}
static
o
bject
*
static
PyO
bject
*
clm_Decompress
(
object
*
self
,
o
bject
*
args
)
clm_Decompress
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
o
bject
*
data
;
PyO
bject
*
data
;
int
numberOfFrames
;
int
numberOfFrames
;
char
*
compressedData
;
char
*
compressedData
;
int
compressedDataSize
,
dataSize
;
int
compressedDataSize
,
dataSize
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getargs
(
args
,
"(is#)"
,
&
numberOfFrames
,
&
compressedData
,
if
(
!
PyArg_Parse
(
args
,
"(is#)"
,
&
numberOfFrames
,
&
compressedData
,
&
compressedDataSize
))
&
compressedDataSize
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
...
@@ -311,28 +314,28 @@ clm_Decompress(object *self, object *args)
...
@@ -311,28 +314,28 @@ clm_Decompress(object *self, object *args)
if
(
error_handler_called
)
if
(
error_handler_called
)
return
NULL
;
return
NULL
;
data
=
newsizedstringobject
(
NULL
,
dataSize
);
data
=
PyString_FromStringAndSize
(
NULL
,
dataSize
);
if
(
data
==
NULL
)
if
(
data
==
NULL
)
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
if
(
clDecompress
(
SELF
->
ob_compressorHdl
,
numberOfFrames
,
if
(
clDecompress
(
SELF
->
ob_compressorHdl
,
numberOfFrames
,
compressedDataSize
,
(
void
*
)
compressedData
,
compressedDataSize
,
(
void
*
)
compressedData
,
(
void
*
)
getstringvalue
(
data
))
==
FAILURE
)
{
(
void
*
)
PyString_AsString
(
data
))
==
FAILURE
)
{
DECREF
(
data
);
Py_
DECREF
(
data
);
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"decompress failed"
);
PyErr_SetString
(
ClError
,
"decompress failed"
);
return
NULL
;
return
NULL
;
}
}
return
data
;
return
data
;
}
}
static
o
bject
*
static
PyO
bject
*
doParams
(
clobject
*
self
,
o
bject
*
args
,
int
(
*
func
)(
CL_Handle
,
int
*
,
int
),
doParams
(
clobject
*
self
,
PyO
bject
*
args
,
int
(
*
func
)(
CL_Handle
,
int
*
,
int
),
int
modified
)
int
modified
)
{
{
o
bject
*
list
,
*
v
;
PyO
bject
*
list
,
*
v
;
int
*
PVbuffer
;
int
*
PVbuffer
;
int
length
;
int
length
;
int
i
;
int
i
;
...
@@ -340,31 +343,31 @@ doParams(clobject *self, object *args, int (*func)(CL_Handle, int *, int),
...
@@ -340,31 +343,31 @@ doParams(clobject *self, object *args, int (*func)(CL_Handle, int *, int),
CheckCompressor
(
self
);
CheckCompressor
(
self
);
if
(
!
getargs
(
args
,
"O"
,
&
list
))
if
(
!
PyArg_Parse
(
args
,
"O"
,
&
list
))
return
NULL
;
return
NULL
;
if
(
!
is_listobject
(
list
))
{
if
(
!
PyList_Check
(
list
))
{
err_badarg
();
PyErr_BadArgument
();
return
NULL
;
return
NULL
;
}
}
length
=
getlists
ize
(
list
);
length
=
PyList_S
ize
(
list
);
PVbuffer
=
NEW
(
int
,
length
);
PVbuffer
=
PyMem_
NEW
(
int
,
length
);
if
(
PVbuffer
==
NULL
)
if
(
PVbuffer
==
NULL
)
return
err_nomem
();
return
PyErr_NoMemory
();
for
(
i
=
0
;
i
<
length
;
i
++
)
{
for
(
i
=
0
;
i
<
length
;
i
++
)
{
v
=
getlisti
tem
(
list
,
i
);
v
=
PyList_GetI
tem
(
list
,
i
);
if
(
is_floatobject
(
v
))
{
if
(
PyFloat_Check
(
v
))
{
number
=
getfloatvalu
e
(
v
);
number
=
PyFloat_AsDoubl
e
(
v
);
PVbuffer
[
i
]
=
CL_TypeIsInt
(
number
);
PVbuffer
[
i
]
=
CL_TypeIsInt
(
number
);
}
else
if
(
is_intobject
(
v
))
{
}
else
if
(
PyInt_Check
(
v
))
{
PVbuffer
[
i
]
=
getintvalue
(
v
);
PVbuffer
[
i
]
=
PyInt_AsLong
(
v
);
if
((
i
&
1
)
&&
if
((
i
&
1
)
&&
param_type_is_float
(
self
,
PVbuffer
[
i
-
1
])
>
0
)
{
param_type_is_float
(
self
,
PVbuffer
[
i
-
1
])
>
0
)
{
number
=
PVbuffer
[
i
];
number
=
PVbuffer
[
i
];
PVbuffer
[
i
]
=
CL_TypeIsInt
(
number
);
PVbuffer
[
i
]
=
CL_TypeIsInt
(
number
);
}
}
}
else
{
}
else
{
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
err_badarg
();
PyErr_BadArgument
();
return
NULL
;
return
NULL
;
}
}
}
}
...
@@ -372,7 +375,7 @@ doParams(clobject *self, object *args, int (*func)(CL_Handle, int *, int),
...
@@ -372,7 +375,7 @@ doParams(clobject *self, object *args, int (*func)(CL_Handle, int *, int),
error_handler_called
=
0
;
error_handler_called
=
0
;
(
*
func
)(
self
->
ob_compressorHdl
,
PVbuffer
,
length
);
(
*
func
)(
self
->
ob_compressorHdl
,
PVbuffer
,
length
);
if
(
error_handler_called
)
{
if
(
error_handler_called
)
{
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
return
NULL
;
return
NULL
;
}
}
...
@@ -381,40 +384,40 @@ doParams(clobject *self, object *args, int (*func)(CL_Handle, int *, int),
...
@@ -381,40 +384,40 @@ doParams(clobject *self, object *args, int (*func)(CL_Handle, int *, int),
if
((
i
&
1
)
&&
if
((
i
&
1
)
&&
param_type_is_float
(
self
,
PVbuffer
[
i
-
1
])
>
0
)
{
param_type_is_float
(
self
,
PVbuffer
[
i
-
1
])
>
0
)
{
number
=
CL_TypeIsFloat
(
PVbuffer
[
i
]);
number
=
CL_TypeIsFloat
(
PVbuffer
[
i
]);
v
=
newfloatobject
(
number
);
v
=
PyFloat_FromDouble
(
number
);
}
else
}
else
v
=
newintobject
(
PVbuffer
[
i
]);
v
=
PyInt_FromLong
(
PVbuffer
[
i
]);
setlisti
tem
(
list
,
i
,
v
);
PyList_SetI
tem
(
list
,
i
,
v
);
}
}
}
}
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
INCREF
(
None
);
Py_INCREF
(
Py_
None
);
return
None
;
return
Py_
None
;
}
}
static
o
bject
*
static
PyO
bject
*
clm_GetParams
(
object
*
self
,
o
bject
*
args
)
clm_GetParams
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
doParams
(
SELF
,
args
,
clGetParams
,
1
);
return
doParams
(
SELF
,
args
,
clGetParams
,
1
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_SetParams
(
object
*
self
,
o
bject
*
args
)
clm_SetParams
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
doParams
(
SELF
,
args
,
clSetParams
,
0
);
return
doParams
(
SELF
,
args
,
clSetParams
,
0
);
}
}
static
o
bject
*
static
PyO
bject
*
do_get
(
clobject
*
self
,
o
bject
*
args
,
int
(
*
func
)(
CL_Handle
,
int
))
do_get
(
clobject
*
self
,
PyO
bject
*
args
,
int
(
*
func
)(
CL_Handle
,
int
))
{
{
int
paramID
,
value
;
int
paramID
,
value
;
float
fvalue
;
float
fvalue
;
CheckCompressor
(
self
);
CheckCompressor
(
self
);
if
(
!
getargs
(
args
,
"i"
,
&
paramID
))
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
paramID
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
...
@@ -424,37 +427,38 @@ do_get(clobject *self, object *args, int (*func)(CL_Handle, int))
...
@@ -424,37 +427,38 @@ do_get(clobject *self, object *args, int (*func)(CL_Handle, int))
if
(
param_type_is_float
(
self
,
paramID
)
>
0
)
{
if
(
param_type_is_float
(
self
,
paramID
)
>
0
)
{
fvalue
=
CL_TypeIsFloat
(
value
);
fvalue
=
CL_TypeIsFloat
(
value
);
return
newfloatobject
(
fvalue
);
return
PyFloat_FromDouble
(
fvalue
);
}
}
return
newintobject
(
value
);
return
PyInt_FromLong
(
value
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_GetParam
(
object
*
self
,
o
bject
*
args
)
clm_GetParam
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
do_get
(
SELF
,
args
,
clGetParam
);
return
do_get
(
SELF
,
args
,
clGetParam
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_GetDefault
(
object
*
self
,
o
bject
*
args
)
clm_GetDefault
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
do_get
(
SELF
,
args
,
clGetDefault
);
return
do_get
(
SELF
,
args
,
clGetDefault
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_SetParam
(
object
*
self
,
o
bject
*
args
)
clm_SetParam
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
paramID
,
value
;
int
paramID
,
value
;
float
fvalue
;
float
fvalue
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getargs
(
args
,
"(ii)"
,
&
paramID
,
&
value
))
{
if
(
!
PyArg_Parse
(
args
,
"(ii)"
,
&
paramID
,
&
value
))
{
err_clear
();
PyErr_Clear
();
if
(
!
getargs
(
args
,
"(if)"
,
&
paramID
,
&
fvalue
))
{
if
(
!
PyArg_Parse
(
args
,
"(if)"
,
&
paramID
,
&
fvalue
))
{
err_clear
();
PyErr_Clear
();
err_setstr
(
TypeError
,
"bad argument list (format '(ii)' or '(if)')"
);
PyErr_SetString
(
PyExc_TypeError
,
"bad argument list (format '(ii)' or '(if)')"
);
return
NULL
;
return
NULL
;
}
}
value
=
CL_TypeIsInt
(
fvalue
);
value
=
CL_TypeIsInt
(
fvalue
);
...
@@ -471,44 +475,44 @@ clm_SetParam(object *self, object *args)
...
@@ -471,44 +475,44 @@ clm_SetParam(object *self, object *args)
return
NULL
;
return
NULL
;
if
(
param_type_is_float
(
SELF
,
paramID
)
>
0
)
if
(
param_type_is_float
(
SELF
,
paramID
)
>
0
)
return
newfloatobject
(
CL_TypeIsFloat
(
value
));
return
PyFloat_FromDouble
(
CL_TypeIsFloat
(
value
));
else
else
return
newintobject
(
value
);
return
PyInt_FromLong
(
value
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_GetParamID
(
object
*
self
,
o
bject
*
args
)
clm_GetParamID
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
char
*
name
;
char
*
name
;
int
value
;
int
value
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getargs
(
args
,
"s"
,
&
name
))
if
(
!
PyArg_Parse
(
args
,
"s"
,
&
name
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
value
=
clGetParamID
(
SELF
->
ob_compressorHdl
,
name
);
value
=
clGetParamID
(
SELF
->
ob_compressorHdl
,
name
);
if
(
value
==
FAILURE
)
{
if
(
value
==
FAILURE
)
{
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"getparamid failed"
);
PyErr_SetString
(
ClError
,
"getparamid failed"
);
return
NULL
;
return
NULL
;
}
}
return
newintobject
(
value
);
return
PyInt_FromLong
(
value
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_QueryParams
(
object
*
self
,
o
bject
*
args
)
clm_QueryParams
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
bufferlength
;
int
bufferlength
;
int
*
PVbuffer
;
int
*
PVbuffer
;
o
bject
*
list
;
PyO
bject
*
list
;
int
i
;
int
i
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getnoarg
(
args
))
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
...
@@ -516,47 +520,48 @@ clm_QueryParams(object *self, object *args)
...
@@ -516,47 +520,48 @@ clm_QueryParams(object *self, object *args)
if
(
error_handler_called
)
if
(
error_handler_called
)
return
NULL
;
return
NULL
;
PVbuffer
=
NEW
(
int
,
bufferlength
);
PVbuffer
=
PyMem_
NEW
(
int
,
bufferlength
);
if
(
PVbuffer
==
NULL
)
if
(
PVbuffer
==
NULL
)
return
err_nomem
();
return
PyErr_NoMemory
();
bufferlength
=
clQueryParams
(
SELF
->
ob_compressorHdl
,
PVbuffer
,
bufferlength
=
clQueryParams
(
SELF
->
ob_compressorHdl
,
PVbuffer
,
bufferlength
);
bufferlength
);
if
(
error_handler_called
)
{
if
(
error_handler_called
)
{
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
return
NULL
;
return
NULL
;
}
}
list
=
newlistobject
(
bufferlength
);
list
=
PyList_New
(
bufferlength
);
if
(
list
==
NULL
)
{
if
(
list
==
NULL
)
{
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
return
NULL
;
return
NULL
;
}
}
for
(
i
=
0
;
i
<
bufferlength
;
i
++
)
{
for
(
i
=
0
;
i
<
bufferlength
;
i
++
)
{
if
(
i
&
1
)
if
(
i
&
1
)
setlistitem
(
list
,
i
,
newintobject
(
PVbuffer
[
i
]));
PyList_SetItem
(
list
,
i
,
PyInt_FromLong
(
PVbuffer
[
i
]));
else
if
(
PVbuffer
[
i
]
==
0
)
{
else
if
(
PVbuffer
[
i
]
==
0
)
{
INCREF
(
None
);
Py_INCREF
(
Py_
None
);
setlistitem
(
list
,
i
,
None
);
PyList_SetItem
(
list
,
i
,
Py_
None
);
}
else
}
else
setlistitem
(
list
,
i
,
newstringobject
((
char
*
)
PVbuffer
[
i
]));
PyList_SetItem
(
list
,
i
,
PyString_FromString
((
char
*
)
PVbuffer
[
i
]));
}
}
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
return
list
;
return
list
;
}
}
static
o
bject
*
static
PyO
bject
*
clm_GetMinMax
(
object
*
self
,
o
bject
*
args
)
clm_GetMinMax
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
param
,
min
,
max
;
int
param
,
min
,
max
;
float
fmin
,
fmax
;
float
fmin
,
fmax
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getargs
(
args
,
"i"
,
&
param
))
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
param
))
return
NULL
;
return
NULL
;
clGetMinMax
(
SELF
->
ob_compressorHdl
,
param
,
&
min
,
&
max
);
clGetMinMax
(
SELF
->
ob_compressorHdl
,
param
,
&
min
,
&
max
);
...
@@ -564,61 +569,61 @@ clm_GetMinMax(object *self, object *args)
...
@@ -564,61 +569,61 @@ clm_GetMinMax(object *self, object *args)
if
(
param_type_is_float
(
SELF
,
param
)
>
0
)
{
if
(
param_type_is_float
(
SELF
,
param
)
>
0
)
{
fmin
=
CL_TypeIsFloat
(
min
);
fmin
=
CL_TypeIsFloat
(
min
);
fmax
=
CL_TypeIsFloat
(
max
);
fmax
=
CL_TypeIsFloat
(
max
);
return
mkv
alue
(
"(ff)"
,
fmin
,
fmax
);
return
Py_BuildV
alue
(
"(ff)"
,
fmin
,
fmax
);
}
}
return
mkv
alue
(
"(ii)"
,
min
,
max
);
return
Py_BuildV
alue
(
"(ii)"
,
min
,
max
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_GetName
(
object
*
self
,
o
bject
*
args
)
clm_GetName
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
param
;
int
param
;
char
*
name
;
char
*
name
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getargs
(
args
,
"i"
,
&
param
))
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
param
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
name
=
clGetName
(
SELF
->
ob_compressorHdl
,
param
);
name
=
clGetName
(
SELF
->
ob_compressorHdl
,
param
);
if
(
name
==
NULL
||
error_handler_called
)
{
if
(
name
==
NULL
||
error_handler_called
)
{
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"getname failed"
);
PyErr_SetString
(
ClError
,
"getname failed"
);
return
NULL
;
return
NULL
;
}
}
return
newstringobject
(
name
);
return
PyString_FromString
(
name
);
}
}
static
o
bject
*
static
PyO
bject
*
clm_QuerySchemeFromHandle
(
object
*
self
,
o
bject
*
args
)
clm_QuerySchemeFromHandle
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getnoarg
(
args
))
if
(
!
PyArg_NoArgs
(
args
))
return
NULL
;
return
NULL
;
return
newintobject
(
clQuerySchemeFromHandle
(
SELF
->
ob_compressorHdl
));
return
PyInt_FromLong
(
clQuerySchemeFromHandle
(
SELF
->
ob_compressorHdl
));
}
}
static
o
bject
*
static
PyO
bject
*
clm_ReadHeader
(
object
*
self
,
o
bject
*
args
)
clm_ReadHeader
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
char
*
header
;
char
*
header
;
int
headerSize
;
int
headerSize
;
CheckCompressor
(
SELF
);
CheckCompressor
(
SELF
);
if
(
!
getargs
(
args
,
"s#"
,
&
header
,
&
headerSize
))
if
(
!
PyArg_Parse
(
args
,
"s#"
,
&
header
,
&
headerSize
))
return
NULL
;
return
NULL
;
return
newintobject
(
clReadHeader
(
SELF
->
ob_compressorHdl
,
return
PyInt_FromLong
(
clReadHeader
(
SELF
->
ob_compressorHdl
,
headerSize
,
header
));
headerSize
,
header
));
}
}
static
struct
methodlist
compressor_methods
[]
=
{
static
PyMethodDef
compressor_methods
[]
=
{
{
"close"
,
clm_CloseCompressor
},
/* alias */
{
"close"
,
clm_CloseCompressor
},
/* alias */
{
"CloseCompressor"
,
clm_CloseCompressor
},
{
"CloseCompressor"
,
clm_CloseCompressor
},
{
"Compress"
,
clm_Compress
},
{
"Compress"
,
clm_Compress
},
...
@@ -635,7 +640,7 @@ static struct methodlist compressor_methods[] = {
...
@@ -635,7 +640,7 @@ static struct methodlist compressor_methods[] = {
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
static
struct
methodlist
decompressor_methods
[]
=
{
static
PyMethodDef
decompressor_methods
[]
=
{
{
"close"
,
clm_CloseDecompressor
},
/* alias */
{
"close"
,
clm_CloseDecompressor
},
/* alias */
{
"CloseDecompressor"
,
clm_CloseDecompressor
},
{
"CloseDecompressor"
,
clm_CloseDecompressor
},
{
"Decompress"
,
clm_Decompress
},
{
"Decompress"
,
clm_Decompress
},
...
@@ -654,7 +659,7 @@ static struct methodlist decompressor_methods[] = {
...
@@ -654,7 +659,7 @@ static struct methodlist decompressor_methods[] = {
};
};
static
void
static
void
cl_dealloc
(
o
bject
*
self
)
cl_dealloc
(
PyO
bject
*
self
)
{
{
if
(
SELF
->
ob_compressorHdl
)
{
if
(
SELF
->
ob_compressorHdl
)
{
if
(
SELF
->
ob_isCompressor
)
if
(
SELF
->
ob_isCompressor
)
...
@@ -662,20 +667,20 @@ cl_dealloc(object *self)
...
@@ -662,20 +667,20 @@ cl_dealloc(object *self)
else
else
clCloseDecompressor
(
SELF
->
ob_compressorHdl
);
clCloseDecompressor
(
SELF
->
ob_compressorHdl
);
}
}
DEL
(
self
);
PyMem_
DEL
(
self
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_getattr
(
o
bject
*
self
,
char
*
name
)
cl_getattr
(
PyO
bject
*
self
,
char
*
name
)
{
{
if
(
SELF
->
ob_isCompressor
)
if
(
SELF
->
ob_isCompressor
)
return
findm
ethod
(
compressor_methods
,
self
,
name
);
return
Py_FindM
ethod
(
compressor_methods
,
self
,
name
);
else
else
return
findm
ethod
(
decompressor_methods
,
self
,
name
);
return
Py_FindM
ethod
(
decompressor_methods
,
self
,
name
);
}
}
static
typeo
bject
Cltype
=
{
static
PyTypeO
bject
Cltype
=
{
OB_HEAD_INIT
(
&
Typet
ype
)
PyObject_HEAD_INIT
(
&
PyType_T
ype
)
0
,
/*ob_size*/
0
,
/*ob_size*/
"cl"
,
/*tp_name*/
"cl"
,
/*tp_name*/
sizeof
(
clobject
),
/*tp_size*/
sizeof
(
clobject
),
/*tp_size*/
...
@@ -692,17 +697,17 @@ static typeobject Cltype = {
...
@@ -692,17 +697,17 @@ static typeobject Cltype = {
0
,
/*tp_as_mapping*/
0
,
/*tp_as_mapping*/
};
};
static
o
bject
*
static
PyO
bject
*
doOpen
(
object
*
self
,
o
bject
*
args
,
int
(
*
open_func
)(
int
,
CL_Handle
*
),
doOpen
(
PyObject
*
self
,
PyO
bject
*
args
,
int
(
*
open_func
)(
int
,
CL_Handle
*
),
int
iscompressor
)
int
iscompressor
)
{
{
int
scheme
;
int
scheme
;
clobject
*
new
;
clobject
*
new
;
if
(
!
getargs
(
args
,
"i"
,
&
scheme
))
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
scheme
))
return
NULL
;
return
NULL
;
new
=
NEWOBJ
(
clobject
,
&
Cltype
);
new
=
PyObject_NEW
(
clobject
,
&
Cltype
);
if
(
new
==
NULL
)
if
(
new
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -712,66 +717,66 @@ doOpen(object *self, object *args, int (*open_func)(int, CL_Handle *),
...
@@ -712,66 +717,66 @@ doOpen(object *self, object *args, int (*open_func)(int, CL_Handle *),
error_handler_called
=
0
;
error_handler_called
=
0
;
if
((
*
open_func
)(
scheme
,
&
new
->
ob_compressorHdl
)
==
FAILURE
)
{
if
((
*
open_func
)(
scheme
,
&
new
->
ob_compressorHdl
)
==
FAILURE
)
{
DECREF
(
new
);
Py_
DECREF
(
new
);
if
(
!
error_handler_called
)
if
(
!
error_handler_called
)
err_setstr
(
ClError
,
"Open(De)Compressor failed"
);
PyErr_SetString
(
ClError
,
"Open(De)Compressor failed"
);
return
NULL
;
return
NULL
;
}
}
return
(
o
bject
*
)
new
;
return
(
PyO
bject
*
)
new
;
}
}
static
o
bject
*
static
PyO
bject
*
cl_OpenCompressor
(
object
*
self
,
o
bject
*
args
)
cl_OpenCompressor
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
doOpen
(
self
,
args
,
clOpenCompressor
,
1
);
return
doOpen
(
self
,
args
,
clOpenCompressor
,
1
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_OpenDecompressor
(
object
*
self
,
o
bject
*
args
)
cl_OpenDecompressor
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
doOpen
(
self
,
args
,
clOpenDecompressor
,
0
);
return
doOpen
(
self
,
args
,
clOpenDecompressor
,
0
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_QueryScheme
(
object
*
self
,
o
bject
*
args
)
cl_QueryScheme
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
char
*
header
;
char
*
header
;
int
headerlen
;
int
headerlen
;
int
scheme
;
int
scheme
;
if
(
!
getargs
(
args
,
"s#"
,
&
header
,
&
headerlen
))
if
(
!
PyArg_Parse
(
args
,
"s#"
,
&
header
,
&
headerlen
))
return
NULL
;
return
NULL
;
scheme
=
clQueryScheme
(
header
);
scheme
=
clQueryScheme
(
header
);
if
(
scheme
<
0
)
{
if
(
scheme
<
0
)
{
err_setstr
(
ClError
,
"unknown compression scheme"
);
PyErr_SetString
(
ClError
,
"unknown compression scheme"
);
return
NULL
;
return
NULL
;
}
}
return
newintobject
(
scheme
);
return
PyInt_FromLong
(
scheme
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_QueryMaxHeaderSize
(
object
*
self
,
o
bject
*
args
)
cl_QueryMaxHeaderSize
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
scheme
;
int
scheme
;
if
(
!
getargs
(
args
,
"i"
,
&
scheme
))
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
scheme
))
return
NULL
;
return
NULL
;
return
newintobject
(
clQueryMaxHeaderSize
(
scheme
));
return
PyInt_FromLong
(
clQueryMaxHeaderSize
(
scheme
));
}
}
static
o
bject
*
static
PyO
bject
*
cl_QueryAlgorithms
(
object
*
self
,
o
bject
*
args
)
cl_QueryAlgorithms
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
algorithmMediaType
;
int
algorithmMediaType
;
int
bufferlength
;
int
bufferlength
;
int
*
PVbuffer
;
int
*
PVbuffer
;
o
bject
*
list
;
PyO
bject
*
list
;
int
i
;
int
i
;
if
(
!
getargs
(
args
,
"i"
,
&
algorithmMediaType
))
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
algorithmMediaType
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
...
@@ -779,88 +784,90 @@ cl_QueryAlgorithms(object *self, object *args)
...
@@ -779,88 +784,90 @@ cl_QueryAlgorithms(object *self, object *args)
if
(
error_handler_called
)
if
(
error_handler_called
)
return
NULL
;
return
NULL
;
PVbuffer
=
NEW
(
int
,
bufferlength
);
PVbuffer
=
PyMem_
NEW
(
int
,
bufferlength
);
if
(
PVbuffer
==
NULL
)
if
(
PVbuffer
==
NULL
)
return
err_nomem
();
return
PyErr_NoMemory
();
bufferlength
=
clQueryAlgorithms
(
algorithmMediaType
,
PVbuffer
,
bufferlength
=
clQueryAlgorithms
(
algorithmMediaType
,
PVbuffer
,
bufferlength
);
bufferlength
);
if
(
error_handler_called
)
{
if
(
error_handler_called
)
{
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
return
NULL
;
return
NULL
;
}
}
list
=
newlistobject
(
bufferlength
);
list
=
PyList_New
(
bufferlength
);
if
(
list
==
NULL
)
{
if
(
list
==
NULL
)
{
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
return
NULL
;
return
NULL
;
}
}
for
(
i
=
0
;
i
<
bufferlength
;
i
++
)
{
for
(
i
=
0
;
i
<
bufferlength
;
i
++
)
{
if
(
i
&
1
)
if
(
i
&
1
)
setlistitem
(
list
,
i
,
newintobject
(
PVbuffer
[
i
]));
PyList_SetItem
(
list
,
i
,
PyInt_FromLong
(
PVbuffer
[
i
]));
else
if
(
PVbuffer
[
i
]
==
0
)
{
else
if
(
PVbuffer
[
i
]
==
0
)
{
INCREF
(
None
);
Py_INCREF
(
Py_
None
);
setlistitem
(
list
,
i
,
None
);
PyList_SetItem
(
list
,
i
,
Py_
None
);
}
else
}
else
setlistitem
(
list
,
i
,
newstringobject
((
char
*
)
PVbuffer
[
i
]));
PyList_SetItem
(
list
,
i
,
PyString_FromString
((
char
*
)
PVbuffer
[
i
]));
}
}
DEL
(
PVbuffer
);
PyMem_
DEL
(
PVbuffer
);
return
list
;
return
list
;
}
}
static
o
bject
*
static
PyO
bject
*
cl_QuerySchemeFromName
(
object
*
self
,
o
bject
*
args
)
cl_QuerySchemeFromName
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
algorithmMediaType
;
int
algorithmMediaType
;
char
*
name
;
char
*
name
;
int
scheme
;
int
scheme
;
if
(
!
getargs
(
args
,
"(is)"
,
&
algorithmMediaType
,
&
name
))
if
(
!
PyArg_Parse
(
args
,
"(is)"
,
&
algorithmMediaType
,
&
name
))
return
NULL
;
return
NULL
;
error_handler_called
=
0
;
error_handler_called
=
0
;
scheme
=
clQuerySchemeFromName
(
algorithmMediaType
,
name
);
scheme
=
clQuerySchemeFromName
(
algorithmMediaType
,
name
);
if
(
error_handler_called
)
{
if
(
error_handler_called
)
{
err_setstr
(
ClError
,
"unknown compression scheme"
);
PyErr_SetString
(
ClError
,
"unknown compression scheme"
);
return
NULL
;
return
NULL
;
}
}
return
newintobject
(
scheme
);
return
PyInt_FromLong
(
scheme
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_GetAlgorithmName
(
object
*
self
,
o
bject
*
args
)
cl_GetAlgorithmName
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
scheme
;
int
scheme
;
char
*
name
;
char
*
name
;
if
(
!
getargs
(
args
,
"i"
,
&
scheme
))
if
(
!
PyArg_Parse
(
args
,
"i"
,
&
scheme
))
return
NULL
;
return
NULL
;
name
=
clGetAlgorithmName
(
scheme
);
name
=
clGetAlgorithmName
(
scheme
);
if
(
name
==
0
)
{
if
(
name
==
0
)
{
err_setstr
(
ClError
,
"unknown compression scheme"
);
PyErr_SetString
(
ClError
,
"unknown compression scheme"
);
return
NULL
;
return
NULL
;
}
}
return
newstringobject
(
name
);
return
PyString_FromString
(
name
);
}
}
static
o
bject
*
static
PyO
bject
*
do_set
(
object
*
self
,
o
bject
*
args
,
int
(
*
func
)(
int
,
int
,
int
))
do_set
(
PyObject
*
self
,
PyO
bject
*
args
,
int
(
*
func
)(
int
,
int
,
int
))
{
{
int
scheme
,
paramID
,
value
;
int
scheme
,
paramID
,
value
;
float
fvalue
;
float
fvalue
;
int
is_float
=
0
;
int
is_float
=
0
;
if
(
!
getargs
(
args
,
"(iii)"
,
&
scheme
,
&
paramID
,
&
value
))
{
if
(
!
PyArg_Parse
(
args
,
"(iii)"
,
&
scheme
,
&
paramID
,
&
value
))
{
err_clear
();
PyErr_Clear
();
if
(
!
getargs
(
args
,
"(iif)"
,
&
scheme
,
&
paramID
,
&
fvalue
))
{
if
(
!
PyArg_Parse
(
args
,
"(iif)"
,
&
scheme
,
&
paramID
,
&
fvalue
))
{
err_clear
();
PyErr_Clear
();
err_setstr
(
TypeError
,
"bad argument list (format '(iii)' or '(iif)')"
);
PyErr_SetString
(
PyExc_TypeError
,
"bad argument list (format '(iii)' or '(iif)')"
);
return
NULL
;
return
NULL
;
}
}
value
=
CL_TypeIsInt
(
fvalue
);
value
=
CL_TypeIsInt
(
fvalue
);
...
@@ -883,75 +890,75 @@ do_set(object *self, object *args, int (*func)(int, int, int))
...
@@ -883,75 +890,75 @@ do_set(object *self, object *args, int (*func)(int, int, int))
return
NULL
;
return
NULL
;
if
(
is_float
)
if
(
is_float
)
return
newfloatobject
(
CL_TypeIsFloat
(
value
));
return
PyFloat_FromDouble
(
CL_TypeIsFloat
(
value
));
else
else
return
newintobject
(
value
);
return
PyInt_FromLong
(
value
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_SetDefault
(
object
*
self
,
o
bject
*
args
)
cl_SetDefault
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
do_set
(
self
,
args
,
clSetDefault
);
return
do_set
(
self
,
args
,
clSetDefault
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_SetMin
(
object
*
self
,
o
bject
*
args
)
cl_SetMin
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
do_set
(
self
,
args
,
clSetMin
);
return
do_set
(
self
,
args
,
clSetMin
);
}
}
static
o
bject
*
static
PyO
bject
*
cl_SetMax
(
object
*
self
,
o
bject
*
args
)
cl_SetMax
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
return
do_set
(
self
,
args
,
clSetMax
);
return
do_set
(
self
,
args
,
clSetMax
);
}
}
#define func(name,
type
) \
#define func(name,
handler
) \
static object *cl_##name(object *self, o
bject *args) \
static PyObject *cl_##name(PyObject *self, PyO
bject *args) \
{ \
{ \
int x; \
int x; \
if (!getargs
(args, "i", &x)) return NULL; \
if (!PyArg_Parse
(args, "i", &x)) return NULL; \
return new##type##object
(CL_##name(x)); \
return Py##handler
(CL_##name(x)); \
}
}
#define func2(name,
type
) \
#define func2(name,
handler
) \
static object *cl_##name(object *self, o
bject *args) \
static PyObject *cl_##name(PyObject *self, PyO
bject *args) \
{ \
{ \
int a1, a2; \
int a1, a2; \
if (!getargs
(args, "(ii)", &a1, &a2)) return NULL; \
if (!PyArg_Parse
(args, "(ii)", &a1, &a2)) return NULL; \
return new##type##object
(CL_##name(a1, a2)); \
return Py##handler
(CL_##name(a1, a2)); \
}
}
func
(
BytesPerSample
,
int
)
func
(
BytesPerSample
,
Int_FromLong
)
func
(
BytesPerPixel
,
int
)
func
(
BytesPerPixel
,
Int_FromLong
)
func
(
AudioFormatName
,
s
tring
)
func
(
AudioFormatName
,
String_FromS
tring
)
func
(
VideoFormatName
,
s
tring
)
func
(
VideoFormatName
,
String_FromS
tring
)
func
(
AlgorithmNumber
,
int
)
func
(
AlgorithmNumber
,
Int_FromLong
)
func
(
AlgorithmType
,
int
)
func
(
AlgorithmType
,
Int_FromLong
)
func2
(
Algorithm
,
int
)
func2
(
Algorithm
,
Int_FromLong
)
func
(
ParamNumber
,
int
)
func
(
ParamNumber
,
Int_FromLong
)
func
(
ParamType
,
int
)
func
(
ParamType
,
Int_FromLong
)
func2
(
ParamID
,
int
)
func2
(
ParamID
,
Int_FromLong
)
#ifdef CLDEBUG
#ifdef CLDEBUG
static
o
bject
*
static
PyO
bject
*
cvt_type
(
object
*
self
,
o
bject
*
args
)
cvt_type
(
PyObject
*
self
,
PyO
bject
*
args
)
{
{
int
number
;
int
number
;
float
fnumber
;
float
fnumber
;
if
(
getargs
(
args
,
"i"
,
&
number
))
if
(
PyArg_Parse
(
args
,
"i"
,
&
number
))
return
newfloatobject
(
CL_TypeIsFloat
(
number
));
return
PyFloat_FromDouble
(
CL_TypeIsFloat
(
number
));
else
{
else
{
err_c
lear
();
PyErr_C
lear
();
if
(
getargs
(
args
,
"f"
,
&
fnumber
))
if
(
PyArg_Parse
(
args
,
"f"
,
&
fnumber
))
return
newintobject
(
CL_TypeIsInt
(
fnumber
));
return
PyInt_FromLong
(
CL_TypeIsInt
(
fnumber
));
return
NULL
;
return
NULL
;
}
}
}
}
#endif
#endif
static
struct
methodlist
cl_methods
[]
=
{
static
PyMethodDef
cl_methods
[]
=
{
{
"CompressImage"
,
cl_CompressImage
},
{
"CompressImage"
,
cl_CompressImage
},
{
"DecompressImage"
,
cl_DecompressImage
},
{
"DecompressImage"
,
cl_DecompressImage
},
{
"GetAlgorithmName"
,
cl_GetAlgorithmName
},
{
"GetAlgorithmName"
,
cl_GetAlgorithmName
},
...
@@ -987,302 +994,349 @@ static struct methodlist cl_methods[] = {
...
@@ -987,302 +994,349 @@ static struct methodlist cl_methods[] = {
void
void
initcl
()
initcl
()
{
{
object
*
m
,
*
d
;
PyObject
*
m
,
*
d
;
m
=
initmodule
(
"cl"
,
cl_methods
);
m
=
Py_InitModule
(
"cl"
,
cl_methods
);
d
=
getmoduledict
(
m
);
d
=
PyModule_GetDict
(
m
);
ClError
=
newstringobject
(
"cl.error"
);
ClError
=
PyString_FromString
(
"cl.error"
);
(
void
)
dictinsert
(
d
,
"error"
,
ClError
);
(
void
)
PyDict_SetItemString
(
d
,
"error"
,
ClError
);
(
void
)
dictinsert
(
d
,
"MAX_NUMBER_OF_ORIGINAL_FORMATS"
,
(
void
)
PyDict_SetItemString
(
d
,
"MAX_NUMBER_OF_ORIGINAL_FORMATS"
,
newintobject
(
CL_MAX_NUMBER_OF_ORIGINAL_FORMATS
));
PyInt_FromLong
(
CL_MAX_NUMBER_OF_ORIGINAL_FORMATS
));
(
void
)
dictinsert
(
d
,
"MONO"
,
newintobject
(
CL_MONO
));
(
void
)
PyDict_SetItemString
(
d
,
"MONO"
,
PyInt_FromLong
(
CL_MONO
));
(
void
)
dictinsert
(
d
,
"STEREO_INTERLEAVED"
,
(
void
)
PyDict_SetItemString
(
d
,
"STEREO_INTERLEAVED"
,
newintobject
(
CL_STEREO_INTERLEAVED
));
PyInt_FromLong
(
CL_STEREO_INTERLEAVED
));
(
void
)
dictinsert
(
d
,
"RGB"
,
newintobject
(
CL_RGB
));
(
void
)
PyDict_SetItemString
(
d
,
"RGB"
,
PyInt_FromLong
(
CL_RGB
));
(
void
)
dictinsert
(
d
,
"RGBX"
,
newintobject
(
CL_RGBX
));
(
void
)
PyDict_SetItemString
(
d
,
"RGBX"
,
PyInt_FromLong
(
CL_RGBX
));
(
void
)
dictinsert
(
d
,
"RGBA"
,
newintobject
(
CL_RGBA
));
(
void
)
PyDict_SetItemString
(
d
,
"RGBA"
,
PyInt_FromLong
(
CL_RGBA
));
(
void
)
dictinsert
(
d
,
"RGB332"
,
newintobject
(
CL_RGB332
));
(
void
)
PyDict_SetItemString
(
d
,
"RGB332"
,
PyInt_FromLong
(
CL_RGB332
));
(
void
)
dictinsert
(
d
,
"GRAYSCALE"
,
newintobject
(
CL_GRAYSCALE
));
(
void
)
PyDict_SetItemString
(
d
,
"GRAYSCALE"
,
(
void
)
dictinsert
(
d
,
"Y"
,
newintobject
(
CL_Y
));
PyInt_FromLong
(
CL_GRAYSCALE
));
(
void
)
dictinsert
(
d
,
"YUV"
,
newintobject
(
CL_YUV
));
(
void
)
PyDict_SetItemString
(
d
,
"Y"
,
PyInt_FromLong
(
CL_Y
));
(
void
)
dictinsert
(
d
,
"YCbCr"
,
newintobject
(
CL_YCbCr
));
(
void
)
PyDict_SetItemString
(
d
,
"YUV"
,
PyInt_FromLong
(
CL_YUV
));
(
void
)
dictinsert
(
d
,
"YUV422"
,
newintobject
(
CL_YUV422
));
(
void
)
PyDict_SetItemString
(
d
,
"YCbCr"
,
PyInt_FromLong
(
CL_YCbCr
));
(
void
)
dictinsert
(
d
,
"YCbCr422"
,
newintobject
(
CL_YCbCr422
));
(
void
)
PyDict_SetItemString
(
d
,
"YUV422"
,
PyInt_FromLong
(
CL_YUV422
));
(
void
)
dictinsert
(
d
,
"YUV422HC"
,
newintobject
(
CL_YUV422HC
));
(
void
)
PyDict_SetItemString
(
d
,
"YCbCr422"
,
(
void
)
dictinsert
(
d
,
"YCbCr422HC"
,
newintobject
(
CL_YCbCr422HC
));
PyInt_FromLong
(
CL_YCbCr422
));
(
void
)
dictinsert
(
d
,
"YUV422DC"
,
newintobject
(
CL_YUV422DC
));
(
void
)
PyDict_SetItemString
(
d
,
"YUV422HC"
,
(
void
)
dictinsert
(
d
,
"YCbCr422DC"
,
newintobject
(
CL_YCbCr422DC
));
PyInt_FromLong
(
CL_YUV422HC
));
(
void
)
dictinsert
(
d
,
"RGB8"
,
newintobject
(
CL_RGB8
));
(
void
)
PyDict_SetItemString
(
d
,
"YCbCr422HC"
,
(
void
)
dictinsert
(
d
,
"BEST_FIT"
,
newintobject
(
CL_BEST_FIT
));
PyInt_FromLong
(
CL_YCbCr422HC
));
(
void
)
dictinsert
(
d
,
"MAX_NUMBER_OF_AUDIO_ALGORITHMS"
,
(
void
)
PyDict_SetItemString
(
d
,
"YUV422DC"
,
newintobject
(
CL_MAX_NUMBER_OF_AUDIO_ALGORITHMS
));
PyInt_FromLong
(
CL_YUV422DC
));
(
void
)
dictinsert
(
d
,
"MAX_NUMBER_OF_VIDEO_ALGORITHMS"
,
(
void
)
PyDict_SetItemString
(
d
,
"YCbCr422DC"
,
newintobject
(
CL_MAX_NUMBER_OF_VIDEO_ALGORITHMS
));
PyInt_FromLong
(
CL_YCbCr422DC
));
(
void
)
dictinsert
(
d
,
"AUDIO"
,
newintobject
(
CL_AUDIO
));
(
void
)
PyDict_SetItemString
(
d
,
"RGB8"
,
PyInt_FromLong
(
CL_RGB8
));
(
void
)
dictinsert
(
d
,
"VIDEO"
,
newintobject
(
CL_VIDEO
));
(
void
)
PyDict_SetItemString
(
d
,
"BEST_FIT"
,
(
void
)
dictinsert
(
d
,
"UNKNOWN_SCHEME"
,
PyInt_FromLong
(
CL_BEST_FIT
));
newintobject
(
CL_UNKNOWN_SCHEME
));
(
void
)
PyDict_SetItemString
(
d
,
"MAX_NUMBER_OF_AUDIO_ALGORITHMS"
,
(
void
)
dictinsert
(
d
,
"UNCOMPRESSED_AUDIO"
,
PyInt_FromLong
(
CL_MAX_NUMBER_OF_AUDIO_ALGORITHMS
));
newintobject
(
CL_UNCOMPRESSED_AUDIO
));
(
void
)
PyDict_SetItemString
(
d
,
"MAX_NUMBER_OF_VIDEO_ALGORITHMS"
,
(
void
)
dictinsert
(
d
,
"G711_ULAW"
,
newintobject
(
CL_G711_ULAW
));
PyInt_FromLong
(
CL_MAX_NUMBER_OF_VIDEO_ALGORITHMS
));
(
void
)
dictinsert
(
d
,
"ULAW"
,
newintobject
(
CL_ULAW
));
(
void
)
PyDict_SetItemString
(
d
,
"AUDIO"
,
PyInt_FromLong
(
CL_AUDIO
));
(
void
)
dictinsert
(
d
,
"G711_ALAW"
,
newintobject
(
CL_G711_ALAW
));
(
void
)
PyDict_SetItemString
(
d
,
"VIDEO"
,
PyInt_FromLong
(
CL_VIDEO
));
(
void
)
dictinsert
(
d
,
"ALAW"
,
newintobject
(
CL_ALAW
));
(
void
)
PyDict_SetItemString
(
d
,
"UNKNOWN_SCHEME"
,
(
void
)
dictinsert
(
d
,
"AWARE_MPEG_AUDIO"
,
PyInt_FromLong
(
CL_UNKNOWN_SCHEME
));
newintobject
(
CL_AWARE_MPEG_AUDIO
));
(
void
)
PyDict_SetItemString
(
d
,
"UNCOMPRESSED_AUDIO"
,
(
void
)
dictinsert
(
d
,
"AWARE_MULTIRATE"
,
PyInt_FromLong
(
CL_UNCOMPRESSED_AUDIO
));
newintobject
(
CL_AWARE_MULTIRATE
));
(
void
)
PyDict_SetItemString
(
d
,
"G711_ULAW"
,
(
void
)
dictinsert
(
d
,
"UNCOMPRESSED"
,
newintobject
(
CL_UNCOMPRESSED
));
PyInt_FromLong
(
CL_G711_ULAW
));
(
void
)
dictinsert
(
d
,
"UNCOMPRESSED_VIDEO"
,
(
void
)
PyDict_SetItemString
(
d
,
"ULAW"
,
PyInt_FromLong
(
CL_ULAW
));
newintobject
(
CL_UNCOMPRESSED_VIDEO
));
(
void
)
PyDict_SetItemString
(
d
,
"G711_ALAW"
,
(
void
)
dictinsert
(
d
,
"RLE"
,
newintobject
(
CL_RLE
));
PyInt_FromLong
(
CL_G711_ALAW
));
(
void
)
dictinsert
(
d
,
"JPEG"
,
newintobject
(
CL_JPEG
));
(
void
)
PyDict_SetItemString
(
d
,
"ALAW"
,
PyInt_FromLong
(
CL_ALAW
));
(
void
)
PyDict_SetItemString
(
d
,
"AWARE_MPEG_AUDIO"
,
PyInt_FromLong
(
CL_AWARE_MPEG_AUDIO
));
(
void
)
PyDict_SetItemString
(
d
,
"AWARE_MULTIRATE"
,
PyInt_FromLong
(
CL_AWARE_MULTIRATE
));
(
void
)
PyDict_SetItemString
(
d
,
"UNCOMPRESSED"
,
PyInt_FromLong
(
CL_UNCOMPRESSED
));
(
void
)
PyDict_SetItemString
(
d
,
"UNCOMPRESSED_VIDEO"
,
PyInt_FromLong
(
CL_UNCOMPRESSED_VIDEO
));
(
void
)
PyDict_SetItemString
(
d
,
"RLE"
,
PyInt_FromLong
(
CL_RLE
));
(
void
)
PyDict_SetItemString
(
d
,
"JPEG"
,
PyInt_FromLong
(
CL_JPEG
));
#ifdef IRIX_5_3_LIBRARY
#ifdef IRIX_5_3_LIBRARY
(
void
)
dictinsert
(
d
,
"JPEG_SOFTWARE"
,
newintobject
(
CL_JPEG_SOFTWARE
));
(
void
)
PyDict_SetItemString
(
d
,
"JPEG_SOFTWARE"
,
PyInt_FromLong
(
CL_JPEG_SOFTWARE
));
#endif
#endif
(
void
)
dictinsert
(
d
,
"MPEG_VIDEO"
,
newintobject
(
CL_MPEG_VIDEO
));
(
void
)
PyDict_SetItemString
(
d
,
"MPEG_VIDEO"
,
(
void
)
dictinsert
(
d
,
"MVC1"
,
newintobject
(
CL_MVC1
));
PyInt_FromLong
(
CL_MPEG_VIDEO
));
(
void
)
dictinsert
(
d
,
"RTR"
,
newintobject
(
CL_RTR
));
(
void
)
PyDict_SetItemString
(
d
,
"MVC1"
,
PyInt_FromLong
(
CL_MVC1
));
(
void
)
dictinsert
(
d
,
"RTR1"
,
newintobject
(
CL_RTR1
));
(
void
)
PyDict_SetItemString
(
d
,
"RTR"
,
PyInt_FromLong
(
CL_RTR
));
(
void
)
dictinsert
(
d
,
"HDCC"
,
newintobject
(
CL_HDCC
));
(
void
)
PyDict_SetItemString
(
d
,
"RTR1"
,
PyInt_FromLong
(
CL_RTR1
));
(
void
)
dictinsert
(
d
,
"MVC2"
,
newintobject
(
CL_MVC2
));
(
void
)
PyDict_SetItemString
(
d
,
"HDCC"
,
PyInt_FromLong
(
CL_HDCC
));
(
void
)
dictinsert
(
d
,
"RLE24"
,
newintobject
(
CL_RLE24
));
(
void
)
PyDict_SetItemString
(
d
,
"MVC2"
,
PyInt_FromLong
(
CL_MVC2
));
(
void
)
dictinsert
(
d
,
"MAX_NUMBER_OF_PARAMS"
,
(
void
)
PyDict_SetItemString
(
d
,
"RLE24"
,
PyInt_FromLong
(
CL_RLE24
));
newintobject
(
CL_MAX_NUMBER_OF_PARAMS
));
(
void
)
PyDict_SetItemString
(
d
,
"MAX_NUMBER_OF_PARAMS"
,
(
void
)
dictinsert
(
d
,
"IMAGE_WIDTH"
,
newintobject
(
CL_IMAGE_WIDTH
));
PyInt_FromLong
(
CL_MAX_NUMBER_OF_PARAMS
));
(
void
)
dictinsert
(
d
,
"IMAGE_HEIGHT"
,
newintobject
(
CL_IMAGE_HEIGHT
));
(
void
)
PyDict_SetItemString
(
d
,
"IMAGE_WIDTH"
,
(
void
)
dictinsert
(
d
,
"ORIGINAL_FORMAT"
,
PyInt_FromLong
(
CL_IMAGE_WIDTH
));
newintobject
(
CL_ORIGINAL_FORMAT
));
(
void
)
PyDict_SetItemString
(
d
,
"IMAGE_HEIGHT"
,
(
void
)
dictinsert
(
d
,
"INTERNAL_FORMAT"
,
PyInt_FromLong
(
CL_IMAGE_HEIGHT
));
newintobject
(
CL_INTERNAL_FORMAT
));
(
void
)
PyDict_SetItemString
(
d
,
"ORIGINAL_FORMAT"
,
(
void
)
dictinsert
(
d
,
"COMPONENTS"
,
newintobject
(
CL_COMPONENTS
));
PyInt_FromLong
(
CL_ORIGINAL_FORMAT
));
(
void
)
dictinsert
(
d
,
"BITS_PER_COMPONENT"
,
(
void
)
PyDict_SetItemString
(
d
,
"INTERNAL_FORMAT"
,
newintobject
(
CL_BITS_PER_COMPONENT
));
PyInt_FromLong
(
CL_INTERNAL_FORMAT
));
(
void
)
dictinsert
(
d
,
"FRAME_RATE"
,
newintobject
(
CL_FRAME_RATE
));
(
void
)
PyDict_SetItemString
(
d
,
"COMPONENTS"
,
(
void
)
dictinsert
(
d
,
"COMPRESSION_RATIO"
,
PyInt_FromLong
(
CL_COMPONENTS
));
newintobject
(
CL_COMPRESSION_RATIO
));
(
void
)
PyDict_SetItemString
(
d
,
"BITS_PER_COMPONENT"
,
(
void
)
dictinsert
(
d
,
"EXACT_COMPRESSION_RATIO"
,
PyInt_FromLong
(
CL_BITS_PER_COMPONENT
));
newintobject
(
CL_EXACT_COMPRESSION_RATIO
));
(
void
)
PyDict_SetItemString
(
d
,
"FRAME_RATE"
,
(
void
)
dictinsert
(
d
,
"FRAME_BUFFER_SIZE"
,
PyInt_FromLong
(
CL_FRAME_RATE
));
newintobject
(
CL_FRAME_BUFFER_SIZE
));
(
void
)
PyDict_SetItemString
(
d
,
"COMPRESSION_RATIO"
,
(
void
)
dictinsert
(
d
,
"COMPRESSED_BUFFER_SIZE"
,
PyInt_FromLong
(
CL_COMPRESSION_RATIO
));
newintobject
(
CL_COMPRESSED_BUFFER_SIZE
));
(
void
)
PyDict_SetItemString
(
d
,
"EXACT_COMPRESSION_RATIO"
,
(
void
)
dictinsert
(
d
,
"BLOCK_SIZE"
,
newintobject
(
CL_BLOCK_SIZE
));
PyInt_FromLong
(
CL_EXACT_COMPRESSION_RATIO
));
(
void
)
dictinsert
(
d
,
"PREROLL"
,
newintobject
(
CL_PREROLL
));
(
void
)
PyDict_SetItemString
(
d
,
"FRAME_BUFFER_SIZE"
,
(
void
)
dictinsert
(
d
,
"FRAME_TYPE"
,
newintobject
(
CL_FRAME_TYPE
));
PyInt_FromLong
(
CL_FRAME_BUFFER_SIZE
));
(
void
)
dictinsert
(
d
,
"ALGORITHM_ID"
,
newintobject
(
CL_ALGORITHM_ID
));
(
void
)
PyDict_SetItemString
(
d
,
"COMPRESSED_BUFFER_SIZE"
,
(
void
)
dictinsert
(
d
,
"ALGORITHM_VERSION"
,
PyInt_FromLong
(
CL_COMPRESSED_BUFFER_SIZE
));
newintobject
(
CL_ALGORITHM_VERSION
));
(
void
)
PyDict_SetItemString
(
d
,
"BLOCK_SIZE"
,
(
void
)
dictinsert
(
d
,
"ORIENTATION"
,
newintobject
(
CL_ORIENTATION
));
PyInt_FromLong
(
CL_BLOCK_SIZE
));
(
void
)
dictinsert
(
d
,
"NUMBER_OF_FRAMES"
,
(
void
)
PyDict_SetItemString
(
d
,
"PREROLL"
,
PyInt_FromLong
(
CL_PREROLL
));
newintobject
(
CL_NUMBER_OF_FRAMES
));
(
void
)
PyDict_SetItemString
(
d
,
"FRAME_TYPE"
,
(
void
)
dictinsert
(
d
,
"SPEED"
,
newintobject
(
CL_SPEED
));
PyInt_FromLong
(
CL_FRAME_TYPE
));
(
void
)
dictinsert
(
d
,
"LAST_FRAME_INDEX"
,
(
void
)
PyDict_SetItemString
(
d
,
"ALGORITHM_ID"
,
newintobject
(
CL_LAST_FRAME_INDEX
));
PyInt_FromLong
(
CL_ALGORITHM_ID
));
(
void
)
PyDict_SetItemString
(
d
,
"ALGORITHM_VERSION"
,
PyInt_FromLong
(
CL_ALGORITHM_VERSION
));
(
void
)
PyDict_SetItemString
(
d
,
"ORIENTATION"
,
PyInt_FromLong
(
CL_ORIENTATION
));
(
void
)
PyDict_SetItemString
(
d
,
"NUMBER_OF_FRAMES"
,
PyInt_FromLong
(
CL_NUMBER_OF_FRAMES
));
(
void
)
PyDict_SetItemString
(
d
,
"SPEED"
,
PyInt_FromLong
(
CL_SPEED
));
(
void
)
PyDict_SetItemString
(
d
,
"LAST_FRAME_INDEX"
,
PyInt_FromLong
(
CL_LAST_FRAME_INDEX
));
#ifdef IRIX_5_3_LIBRARY
#ifdef IRIX_5_3_LIBRARY
(
void
)
dictinsert
(
d
,
"ENABLE_IMAGEINFO"
,
(
void
)
PyDict_SetItemString
(
d
,
"ENABLE_IMAGEINFO"
,
newintobject
(
CL_ENABLE_IMAGEINFO
));
PyInt_FromLong
(
CL_ENABLE_IMAGEINFO
));
(
void
)
dictinsert
(
d
,
"INTERNAL_IMAGE_WIDTH"
,
(
void
)
PyDict_SetItemString
(
d
,
"INTERNAL_IMAGE_WIDTH"
,
newintobject
(
CL_INTERNAL_IMAGE_WIDTH
));
PyInt_FromLong
(
CL_INTERNAL_IMAGE_WIDTH
));
(
void
)
dictinsert
(
d
,
"INTERNAL_IMAGE_HEIGHT"
,
(
void
)
PyDict_SetItemString
(
d
,
"INTERNAL_IMAGE_HEIGHT"
,
newintobject
(
CL_INTERNAL_IMAGE_HEIGHT
));
PyInt_FromLong
(
CL_INTERNAL_IMAGE_HEIGHT
));
#endif
#endif
(
void
)
dictinsert
(
d
,
"NUMBER_OF_PARAMS"
,
(
void
)
PyDict_SetItemString
(
d
,
"NUMBER_OF_PARAMS"
,
newintobject
(
CL_NUMBER_OF_PARAMS
));
PyInt_FromLong
(
CL_NUMBER_OF_PARAMS
));
#ifdef IRIX_5_3_LIBRARY
#ifdef IRIX_5_3_LIBRARY
(
void
)
dictinsert
(
d
,
"MVC2_LUMA_THRESHOLD"
,
(
void
)
PyDict_SetItemString
(
d
,
"MVC2_LUMA_THRESHOLD"
,
newintobject
(
CL_MVC2_LUMA_THRESHOLD
));
PyInt_FromLong
(
CL_MVC2_LUMA_THRESHOLD
));
(
void
)
dictinsert
(
d
,
"MVC2_CHROMA_THRESHOLD"
,
(
void
)
PyDict_SetItemString
(
d
,
"MVC2_CHROMA_THRESHOLD"
,
newintobject
(
CL_MVC2_CHROMA_THRESHOLD
));
PyInt_FromLong
(
CL_MVC2_CHROMA_THRESHOLD
));
(
void
)
dictinsert
(
d
,
"MVC2_EDGE_THRESHOLD"
,
(
void
)
PyDict_SetItemString
(
d
,
"MVC2_EDGE_THRESHOLD"
,
newintobject
(
CL_MVC2_EDGE_THRESHOLD
));
PyInt_FromLong
(
CL_MVC2_EDGE_THRESHOLD
));
(
void
)
dictinsert
(
d
,
"MVC2_BLENDING"
,
newintobject
(
CL_MVC2_BLENDING
));
(
void
)
PyDict_SetItemString
(
d
,
"MVC2_BLENDING"
,
(
void
)
dictinsert
(
d
,
"MVC2_BLENDING_OFF"
,
PyInt_FromLong
(
CL_MVC2_BLENDING
));
newintobject
(
CL_MVC2_BLENDING_OFF
));
(
void
)
PyDict_SetItemString
(
d
,
"MVC2_BLENDING_OFF"
,
(
void
)
dictinsert
(
d
,
"MVC2_BLENDING_ON"
,
PyInt_FromLong
(
CL_MVC2_BLENDING_OFF
));
newintobject
(
CL_MVC2_BLENDING_ON
));
(
void
)
PyDict_SetItemString
(
d
,
"MVC2_BLENDING_ON"
,
(
void
)
dictinsert
(
d
,
"JPEG_QUALITY_FACTOR"
,
PyInt_FromLong
(
CL_MVC2_BLENDING_ON
));
newintobject
(
CL_JPEG_QUALITY_FACTOR
));
(
void
)
PyDict_SetItemString
(
d
,
"JPEG_QUALITY_FACTOR"
,
(
void
)
dictinsert
(
d
,
"JPEG_STREAM_HEADERS"
,
PyInt_FromLong
(
CL_JPEG_QUALITY_FACTOR
));
newintobject
(
CL_JPEG_STREAM_HEADERS
));
(
void
)
PyDict_SetItemString
(
d
,
"JPEG_STREAM_HEADERS"
,
(
void
)
dictinsert
(
d
,
"JPEG_QUANTIZATION_TABLES"
,
PyInt_FromLong
(
CL_JPEG_STREAM_HEADERS
));
newintobject
(
CL_JPEG_QUANTIZATION_TABLES
));
(
void
)
PyDict_SetItemString
(
d
,
"JPEG_QUANTIZATION_TABLES"
,
(
void
)
dictinsert
(
d
,
"JPEG_NUM_PARAMS"
,
PyInt_FromLong
(
CL_JPEG_QUANTIZATION_TABLES
));
newintobject
(
CL_JPEG_NUM_PARAMS
));
(
void
)
PyDict_SetItemString
(
d
,
"JPEG_NUM_PARAMS"
,
(
void
)
dictinsert
(
d
,
"RTR_QUALITY_LEVEL"
,
PyInt_FromLong
(
CL_JPEG_NUM_PARAMS
));
newintobject
(
CL_RTR_QUALITY_LEVEL
));
(
void
)
PyDict_SetItemString
(
d
,
"RTR_QUALITY_LEVEL"
,
(
void
)
dictinsert
(
d
,
"HDCC_TILE_THRESHOLD"
,
PyInt_FromLong
(
CL_RTR_QUALITY_LEVEL
));
newintobject
(
CL_HDCC_TILE_THRESHOLD
));
(
void
)
PyDict_SetItemString
(
d
,
"HDCC_TILE_THRESHOLD"
,
(
void
)
dictinsert
(
d
,
"HDCC_SAMPLES_PER_TILE"
,
PyInt_FromLong
(
CL_HDCC_TILE_THRESHOLD
));
newintobject
(
CL_HDCC_SAMPLES_PER_TILE
));
(
void
)
PyDict_SetItemString
(
d
,
"HDCC_SAMPLES_PER_TILE"
,
PyInt_FromLong
(
CL_HDCC_SAMPLES_PER_TILE
));
#endif
#endif
(
void
)
dictinsert
(
d
,
"END_OF_SEQUENCE"
,
(
void
)
PyDict_SetItemString
(
d
,
"END_OF_SEQUENCE"
,
newintobject
(
CL_END_OF_SEQUENCE
));
PyInt_FromLong
(
CL_END_OF_SEQUENCE
));
(
void
)
dictinsert
(
d
,
"CHANNEL_POLICY"
,
(
void
)
PyDict_SetItemString
(
d
,
"CHANNEL_POLICY"
,
newintobject
(
CL_CHANNEL_POLICY
));
PyInt_FromLong
(
CL_CHANNEL_POLICY
));
(
void
)
dictinsert
(
d
,
"NOISE_MARGIN"
,
newintobject
(
CL_NOISE_MARGIN
));
(
void
)
PyDict_SetItemString
(
d
,
"NOISE_MARGIN"
,
(
void
)
dictinsert
(
d
,
"BITRATE_POLICY"
,
PyInt_FromLong
(
CL_NOISE_MARGIN
));
newintobject
(
CL_BITRATE_POLICY
));
(
void
)
PyDict_SetItemString
(
d
,
"BITRATE_POLICY"
,
(
void
)
dictinsert
(
d
,
"BITRATE_TARGET"
,
PyInt_FromLong
(
CL_BITRATE_POLICY
));
newintobject
(
CL_BITRATE_TARGET
));
(
void
)
PyDict_SetItemString
(
d
,
"BITRATE_TARGET"
,
(
void
)
dictinsert
(
d
,
"LAYER"
,
newintobject
(
CL_LAYER
));
PyInt_FromLong
(
CL_BITRATE_TARGET
));
(
void
)
dictinsert
(
d
,
"ENUM_VALUE"
,
newintobject
(
CL_ENUM_VALUE
));
(
void
)
PyDict_SetItemString
(
d
,
"LAYER"
,
PyInt_FromLong
(
CL_LAYER
));
(
void
)
dictinsert
(
d
,
"RANGE_VALUE"
,
newintobject
(
CL_RANGE_VALUE
));
(
void
)
PyDict_SetItemString
(
d
,
"ENUM_VALUE"
,
(
void
)
dictinsert
(
d
,
"FLOATING_ENUM_VALUE"
,
PyInt_FromLong
(
CL_ENUM_VALUE
));
newintobject
(
CL_FLOATING_ENUM_VALUE
));
(
void
)
PyDict_SetItemString
(
d
,
"RANGE_VALUE"
,
(
void
)
dictinsert
(
d
,
"FLOATING_RANGE_VALUE"
,
PyInt_FromLong
(
CL_RANGE_VALUE
));
newintobject
(
CL_FLOATING_RANGE_VALUE
));
(
void
)
PyDict_SetItemString
(
d
,
"FLOATING_ENUM_VALUE"
,
(
void
)
dictinsert
(
d
,
"DECOMPRESSOR"
,
newintobject
(
CL_DECOMPRESSOR
));
PyInt_FromLong
(
CL_FLOATING_ENUM_VALUE
));
(
void
)
dictinsert
(
d
,
"COMPRESSOR"
,
newintobject
(
CL_COMPRESSOR
));
(
void
)
PyDict_SetItemString
(
d
,
"FLOATING_RANGE_VALUE"
,
(
void
)
dictinsert
(
d
,
"CODEC"
,
newintobject
(
CL_CODEC
));
PyInt_FromLong
(
CL_FLOATING_RANGE_VALUE
));
(
void
)
dictinsert
(
d
,
"NONE"
,
newintobject
(
CL_NONE
));
(
void
)
PyDict_SetItemString
(
d
,
"DECOMPRESSOR"
,
PyInt_FromLong
(
CL_DECOMPRESSOR
));
(
void
)
PyDict_SetItemString
(
d
,
"COMPRESSOR"
,
PyInt_FromLong
(
CL_COMPRESSOR
));
(
void
)
PyDict_SetItemString
(
d
,
"CODEC"
,
PyInt_FromLong
(
CL_CODEC
));
(
void
)
PyDict_SetItemString
(
d
,
"NONE"
,
PyInt_FromLong
(
CL_NONE
));
#ifdef IRIX_5_3_LIBRARY
#ifdef IRIX_5_3_LIBRARY
(
void
)
dictinsert
(
d
,
"BUF_FRAME"
,
newintobject
(
CL_BUF_FRAME
));
(
void
)
PyDict_SetItemString
(
d
,
"BUF_FRAME"
,
(
void
)
dictinsert
(
d
,
"BUF_DATA"
,
newintobject
(
CL_BUF_DATA
));
PyInt_FromLong
(
CL_BUF_FRAME
));
(
void
)
PyDict_SetItemString
(
d
,
"BUF_DATA"
,
PyInt_FromLong
(
CL_BUF_DATA
));
#endif
#endif
#ifdef CL_FRAME
#ifdef CL_FRAME
(
void
)
dictinsert
(
d
,
"FRAME"
,
newintobject
(
CL_FRAME
));
(
void
)
PyDict_SetItemString
(
d
,
"FRAME"
,
PyInt_FromLong
(
CL_FRAME
));
(
void
)
dictinsert
(
d
,
"DATA"
,
newintobject
(
CL_DATA
));
(
void
)
PyDict_SetItemString
(
d
,
"DATA"
,
PyInt_FromLong
(
CL_DATA
));
#endif
#endif
(
void
)
dictinsert
(
d
,
"NONE"
,
newintobject
(
CL_NONE
));
(
void
)
PyDict_SetItemString
(
d
,
"NONE"
,
PyInt_FromLong
(
CL_NONE
));
(
void
)
dictinsert
(
d
,
"KEYFRAME"
,
newintobject
(
CL_KEYFRAME
));
(
void
)
PyDict_SetItemString
(
d
,
"KEYFRAME"
,
(
void
)
dictinsert
(
d
,
"INTRA"
,
newintobject
(
CL_INTRA
));
PyInt_FromLong
(
CL_KEYFRAME
));
(
void
)
dictinsert
(
d
,
"PREDICTED"
,
newintobject
(
CL_PREDICTED
));
(
void
)
PyDict_SetItemString
(
d
,
"INTRA"
,
PyInt_FromLong
(
CL_INTRA
));
(
void
)
dictinsert
(
d
,
"BIDIRECTIONAL"
,
newintobject
(
CL_BIDIRECTIONAL
));
(
void
)
PyDict_SetItemString
(
d
,
"PREDICTED"
,
(
void
)
dictinsert
(
d
,
"TOP_DOWN"
,
newintobject
(
CL_TOP_DOWN
));
PyInt_FromLong
(
CL_PREDICTED
));
(
void
)
dictinsert
(
d
,
"BOTTOM_UP"
,
newintobject
(
CL_BOTTOM_UP
));
(
void
)
PyDict_SetItemString
(
d
,
"BIDIRECTIONAL"
,
PyInt_FromLong
(
CL_BIDIRECTIONAL
));
(
void
)
PyDict_SetItemString
(
d
,
"TOP_DOWN"
,
PyInt_FromLong
(
CL_TOP_DOWN
));
(
void
)
PyDict_SetItemString
(
d
,
"BOTTOM_UP"
,
PyInt_FromLong
(
CL_BOTTOM_UP
));
#ifdef IRIX_5_3_LIBRARY
#ifdef IRIX_5_3_LIBRARY
(
void
)
dictinsert
(
d
,
"CONTINUOUS_BLOCK"
,
(
void
)
PyDict_SetItemString
(
d
,
"CONTINUOUS_BLOCK"
,
newintobject
(
CL_CONTINUOUS_BLOCK
));
PyInt_FromLong
(
CL_CONTINUOUS_BLOCK
));
(
void
)
dictinsert
(
d
,
"CONTINUOUS_NONBLOCK"
,
(
void
)
PyDict_SetItemString
(
d
,
"CONTINUOUS_NONBLOCK"
,
newintobject
(
CL_CONTINUOUS_NONBLOCK
));
PyInt_FromLong
(
CL_CONTINUOUS_NONBLOCK
));
(
void
)
dictinsert
(
d
,
"EXTERNAL_DEVICE"
,
(
void
)
PyDict_SetItemString
(
d
,
"EXTERNAL_DEVICE"
,
newintobject
((
long
)
CL_EXTERNAL_DEVICE
));
PyInt_FromLong
((
long
)
CL_EXTERNAL_DEVICE
));
#endif
#endif
(
void
)
dictinsert
(
d
,
"AWCMP_STEREO"
,
newintobject
(
AWCMP_STEREO
));
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_STEREO"
,
(
void
)
dictinsert
(
d
,
"AWCMP_JOINT_STEREO"
,
PyInt_FromLong
(
AWCMP_STEREO
));
newintobject
(
AWCMP_JOINT_STEREO
));
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_JOINT_STEREO"
,
(
void
)
dictinsert
(
d
,
"AWCMP_INDEPENDENT"
,
PyInt_FromLong
(
AWCMP_JOINT_STEREO
));
newintobject
(
AWCMP_INDEPENDENT
));
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_INDEPENDENT"
,
(
void
)
dictinsert
(
d
,
"AWCMP_FIXED_RATE"
,
PyInt_FromLong
(
AWCMP_INDEPENDENT
));
newintobject
(
AWCMP_FIXED_RATE
));
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_FIXED_RATE"
,
(
void
)
dictinsert
(
d
,
"AWCMP_CONST_QUAL"
,
PyInt_FromLong
(
AWCMP_FIXED_RATE
));
newintobject
(
AWCMP_CONST_QUAL
));
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_CONST_QUAL"
,
(
void
)
dictinsert
(
d
,
"AWCMP_LOSSLESS"
,
newintobject
(
AWCMP_LOSSLESS
));
PyInt_FromLong
(
AWCMP_CONST_QUAL
));
(
void
)
dictinsert
(
d
,
"AWCMP_MPEG_LAYER_I"
,
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_LOSSLESS"
,
newintobject
(
AWCMP_MPEG_LAYER_I
));
PyInt_FromLong
(
AWCMP_LOSSLESS
));
(
void
)
dictinsert
(
d
,
"AWCMP_MPEG_LAYER_II"
,
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_MPEG_LAYER_I"
,
newintobject
(
AWCMP_MPEG_LAYER_II
));
PyInt_FromLong
(
AWCMP_MPEG_LAYER_I
));
(
void
)
dictinsert
(
d
,
"HEADER_START_CODE"
,
(
void
)
PyDict_SetItemString
(
d
,
"AWCMP_MPEG_LAYER_II"
,
newintobject
(
CL_HEADER_START_CODE
));
PyInt_FromLong
(
AWCMP_MPEG_LAYER_II
));
(
void
)
dictinsert
(
d
,
"BAD_NO_BUFFERSPACE"
,
(
void
)
PyDict_SetItemString
(
d
,
"HEADER_START_CODE"
,
newintobject
(
CL_BAD_NO_BUFFERSPACE
));
PyInt_FromLong
(
CL_HEADER_START_CODE
));
(
void
)
dictinsert
(
d
,
"BAD_PVBUFFER"
,
newintobject
(
CL_BAD_PVBUFFER
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_NO_BUFFERSPACE"
,
(
void
)
dictinsert
(
d
,
"BAD_BUFFERLENGTH_NEG"
,
PyInt_FromLong
(
CL_BAD_NO_BUFFERSPACE
));
newintobject
(
CL_BAD_BUFFERLENGTH_NEG
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_PVBUFFER"
,
(
void
)
dictinsert
(
d
,
"BAD_BUFFERLENGTH_ODD"
,
PyInt_FromLong
(
CL_BAD_PVBUFFER
));
newintobject
(
CL_BAD_BUFFERLENGTH_ODD
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFERLENGTH_NEG"
,
(
void
)
dictinsert
(
d
,
"BAD_PARAM"
,
newintobject
(
CL_BAD_PARAM
));
PyInt_FromLong
(
CL_BAD_BUFFERLENGTH_NEG
));
(
void
)
dictinsert
(
d
,
"BAD_COMPRESSION_SCHEME"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFERLENGTH_ODD"
,
newintobject
(
CL_BAD_COMPRESSION_SCHEME
));
PyInt_FromLong
(
CL_BAD_BUFFERLENGTH_ODD
));
(
void
)
dictinsert
(
d
,
"BAD_COMPRESSOR_HANDLE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_PARAM"
,
newintobject
(
CL_BAD_COMPRESSOR_HANDLE
));
PyInt_FromLong
(
CL_BAD_PARAM
));
(
void
)
dictinsert
(
d
,
"BAD_COMPRESSOR_HANDLE_POINTER"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_COMPRESSION_SCHEME"
,
newintobject
(
CL_BAD_COMPRESSOR_HANDLE_POINTER
));
PyInt_FromLong
(
CL_BAD_COMPRESSION_SCHEME
));
(
void
)
dictinsert
(
d
,
"BAD_BUFFER_HANDLE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_COMPRESSOR_HANDLE"
,
newintobject
(
CL_BAD_BUFFER_HANDLE
));
PyInt_FromLong
(
CL_BAD_COMPRESSOR_HANDLE
));
(
void
)
dictinsert
(
d
,
"BAD_BUFFER_QUERY_SIZE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_COMPRESSOR_HANDLE_POINTER"
,
newintobject
(
CL_BAD_BUFFER_QUERY_SIZE
));
PyInt_FromLong
(
CL_BAD_COMPRESSOR_HANDLE_POINTER
));
(
void
)
dictinsert
(
d
,
"JPEG_ERROR"
,
newintobject
(
CL_JPEG_ERROR
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFER_HANDLE"
,
(
void
)
dictinsert
(
d
,
"BAD_FRAME_SIZE"
,
PyInt_FromLong
(
CL_BAD_BUFFER_HANDLE
));
newintobject
(
CL_BAD_FRAME_SIZE
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFER_QUERY_SIZE"
,
(
void
)
dictinsert
(
d
,
"PARAM_OUT_OF_RANGE"
,
PyInt_FromLong
(
CL_BAD_BUFFER_QUERY_SIZE
));
newintobject
(
CL_PARAM_OUT_OF_RANGE
));
(
void
)
PyDict_SetItemString
(
d
,
"JPEG_ERROR"
,
(
void
)
dictinsert
(
d
,
"ADDED_ALGORITHM_ERROR"
,
PyInt_FromLong
(
CL_JPEG_ERROR
));
newintobject
(
CL_ADDED_ALGORITHM_ERROR
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_FRAME_SIZE"
,
(
void
)
dictinsert
(
d
,
"BAD_ALGORITHM_TYPE"
,
PyInt_FromLong
(
CL_BAD_FRAME_SIZE
));
newintobject
(
CL_BAD_ALGORITHM_TYPE
));
(
void
)
PyDict_SetItemString
(
d
,
"PARAM_OUT_OF_RANGE"
,
(
void
)
dictinsert
(
d
,
"BAD_ALGORITHM_NAME"
,
PyInt_FromLong
(
CL_PARAM_OUT_OF_RANGE
));
newintobject
(
CL_BAD_ALGORITHM_NAME
));
(
void
)
PyDict_SetItemString
(
d
,
"ADDED_ALGORITHM_ERROR"
,
(
void
)
dictinsert
(
d
,
"BAD_BUFFERING"
,
newintobject
(
CL_BAD_BUFFERING
));
PyInt_FromLong
(
CL_ADDED_ALGORITHM_ERROR
));
(
void
)
dictinsert
(
d
,
"BUFFER_NOT_CREATED"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_ALGORITHM_TYPE"
,
newintobject
(
CL_BUFFER_NOT_CREATED
));
PyInt_FromLong
(
CL_BAD_ALGORITHM_TYPE
));
(
void
)
dictinsert
(
d
,
"BAD_BUFFER_EXISTS"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_ALGORITHM_NAME"
,
newintobject
(
CL_BAD_BUFFER_EXISTS
));
PyInt_FromLong
(
CL_BAD_ALGORITHM_NAME
));
(
void
)
dictinsert
(
d
,
"BAD_INTERNAL_FORMAT"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFERING"
,
newintobject
(
CL_BAD_INTERNAL_FORMAT
));
PyInt_FromLong
(
CL_BAD_BUFFERING
));
(
void
)
dictinsert
(
d
,
"BAD_BUFFER_POINTER"
,
(
void
)
PyDict_SetItemString
(
d
,
"BUFFER_NOT_CREATED"
,
newintobject
(
CL_BAD_BUFFER_POINTER
));
PyInt_FromLong
(
CL_BUFFER_NOT_CREATED
));
(
void
)
dictinsert
(
d
,
"FRAME_BUFFER_SIZE_ZERO"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFER_EXISTS"
,
newintobject
(
CL_FRAME_BUFFER_SIZE_ZERO
));
PyInt_FromLong
(
CL_BAD_BUFFER_EXISTS
));
(
void
)
dictinsert
(
d
,
"BAD_STREAM_HEADER"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_INTERNAL_FORMAT"
,
newintobject
(
CL_BAD_STREAM_HEADER
));
PyInt_FromLong
(
CL_BAD_INTERNAL_FORMAT
));
(
void
)
dictinsert
(
d
,
"BAD_LICENSE"
,
newintobject
(
CL_BAD_LICENSE
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFER_POINTER"
,
(
void
)
dictinsert
(
d
,
"AWARE_ERROR"
,
newintobject
(
CL_AWARE_ERROR
));
PyInt_FromLong
(
CL_BAD_BUFFER_POINTER
));
(
void
)
dictinsert
(
d
,
"BAD_BUFFER_SIZE_POINTER"
,
(
void
)
PyDict_SetItemString
(
d
,
"FRAME_BUFFER_SIZE_ZERO"
,
newintobject
(
CL_BAD_BUFFER_SIZE_POINTER
));
PyInt_FromLong
(
CL_FRAME_BUFFER_SIZE_ZERO
));
(
void
)
dictinsert
(
d
,
"BAD_BUFFER_SIZE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_STREAM_HEADER"
,
newintobject
(
CL_BAD_BUFFER_SIZE
));
PyInt_FromLong
(
CL_BAD_STREAM_HEADER
));
(
void
)
dictinsert
(
d
,
"BAD_BUFFER_TYPE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_LICENSE"
,
newintobject
(
CL_BAD_BUFFER_TYPE
));
PyInt_FromLong
(
CL_BAD_LICENSE
));
(
void
)
dictinsert
(
d
,
"BAD_HEADER_SIZE"
,
(
void
)
PyDict_SetItemString
(
d
,
"AWARE_ERROR"
,
newintobject
(
CL_BAD_HEADER_SIZE
));
PyInt_FromLong
(
CL_AWARE_ERROR
));
(
void
)
dictinsert
(
d
,
"BAD_FUNCTION_POINTER"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFER_SIZE_POINTER"
,
newintobject
(
CL_BAD_FUNCTION_POINTER
));
PyInt_FromLong
(
CL_BAD_BUFFER_SIZE_POINTER
));
(
void
)
dictinsert
(
d
,
"BAD_SCHEME_POINTER"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFER_SIZE"
,
newintobject
(
CL_BAD_SCHEME_POINTER
));
PyInt_FromLong
(
CL_BAD_BUFFER_SIZE
));
(
void
)
dictinsert
(
d
,
"BAD_STRING_POINTER"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BUFFER_TYPE"
,
newintobject
(
CL_BAD_STRING_POINTER
));
PyInt_FromLong
(
CL_BAD_BUFFER_TYPE
));
(
void
)
dictinsert
(
d
,
"BAD_MIN_GT_MAX"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_HEADER_SIZE"
,
newintobject
(
CL_BAD_MIN_GT_MAX
));
PyInt_FromLong
(
CL_BAD_HEADER_SIZE
));
(
void
)
dictinsert
(
d
,
"BAD_INITIAL_VALUE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_FUNCTION_POINTER"
,
newintobject
(
CL_BAD_INITIAL_VALUE
));
PyInt_FromLong
(
CL_BAD_FUNCTION_POINTER
));
(
void
)
dictinsert
(
d
,
"BAD_PARAM_ID_POINTER"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_SCHEME_POINTER"
,
newintobject
(
CL_BAD_PARAM_ID_POINTER
));
PyInt_FromLong
(
CL_BAD_SCHEME_POINTER
));
(
void
)
dictinsert
(
d
,
"BAD_PARAM_TYPE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_STRING_POINTER"
,
newintobject
(
CL_BAD_PARAM_TYPE
));
PyInt_FromLong
(
CL_BAD_STRING_POINTER
));
(
void
)
dictinsert
(
d
,
"BAD_TEXT_STRING_PTR"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_MIN_GT_MAX"
,
newintobject
(
CL_BAD_TEXT_STRING_PTR
));
PyInt_FromLong
(
CL_BAD_MIN_GT_MAX
));
(
void
)
dictinsert
(
d
,
"BAD_FUNCTIONALITY"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_INITIAL_VALUE"
,
newintobject
(
CL_BAD_FUNCTIONALITY
));
PyInt_FromLong
(
CL_BAD_INITIAL_VALUE
));
(
void
)
dictinsert
(
d
,
"BAD_NUMBER_OF_BLOCKS"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_PARAM_ID_POINTER"
,
newintobject
(
CL_BAD_NUMBER_OF_BLOCKS
));
PyInt_FromLong
(
CL_BAD_PARAM_ID_POINTER
));
(
void
)
dictinsert
(
d
,
"BAD_BLOCK_SIZE"
,
(
void
)
PyDict_SetItemString
(
d
,
"BAD_PARAM_TYPE"
,
newintobject
(
CL_BAD_BLOCK_SIZE
));
PyInt_FromLong
(
CL_BAD_PARAM_TYPE
));
(
void
)
dictinsert
(
d
,
"BAD_POINTER"
,
newintobject
(
CL_BAD_POINTER
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_TEXT_STRING_PTR"
,
(
void
)
dictinsert
(
d
,
"BAD_BOARD"
,
newintobject
(
CL_BAD_BOARD
));
PyInt_FromLong
(
CL_BAD_TEXT_STRING_PTR
));
(
void
)
dictinsert
(
d
,
"MVC2_ERROR"
,
newintobject
(
CL_MVC2_ERROR
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_FUNCTIONALITY"
,
PyInt_FromLong
(
CL_BAD_FUNCTIONALITY
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_NUMBER_OF_BLOCKS"
,
PyInt_FromLong
(
CL_BAD_NUMBER_OF_BLOCKS
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BLOCK_SIZE"
,
PyInt_FromLong
(
CL_BAD_BLOCK_SIZE
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_POINTER"
,
PyInt_FromLong
(
CL_BAD_POINTER
));
(
void
)
PyDict_SetItemString
(
d
,
"BAD_BOARD"
,
PyInt_FromLong
(
CL_BAD_BOARD
));
(
void
)
PyDict_SetItemString
(
d
,
"MVC2_ERROR"
,
PyInt_FromLong
(
CL_MVC2_ERROR
));
#ifdef IRIX_5_3_LIBRARY
#ifdef IRIX_5_3_LIBRARY
(
void
)
dictinsert
(
d
,
"NEXT_NOT_AVAILABLE"
,
(
void
)
PyDict_SetItemString
(
d
,
"NEXT_NOT_AVAILABLE"
,
newintobject
(
CL_NEXT_NOT_AVAILABLE
));
PyInt_FromLong
(
CL_NEXT_NOT_AVAILABLE
));
(
void
)
dictinsert
(
d
,
"SCHEME_BUSY"
,
newintobject
(
CL_SCHEME_BUSY
));
(
void
)
PyDict_SetItemString
(
d
,
"SCHEME_BUSY"
,
(
void
)
dictinsert
(
d
,
"SCHEME_NOT_AVAILABLE"
,
PyInt_FromLong
(
CL_SCHEME_BUSY
));
newintobject
(
CL_SCHEME_NOT_AVAILABLE
));
(
void
)
PyDict_SetItemString
(
d
,
"SCHEME_NOT_AVAILABLE"
,
PyInt_FromLong
(
CL_SCHEME_NOT_AVAILABLE
));
#endif
#endif
#ifdef CL_LUMA_THRESHOLD
#ifdef CL_LUMA_THRESHOLD
/* backward compatibility */
/* backward compatibility */
(
void
)
dictinsert
(
d
,
"LUMA_THRESHOLD"
,
(
void
)
PyDict_SetItemString
(
d
,
"LUMA_THRESHOLD"
,
newintobject
(
CL_LUMA_THRESHOLD
));
PyInt_FromLong
(
CL_LUMA_THRESHOLD
));
(
void
)
dictinsert
(
d
,
"CHROMA_THRESHOLD"
,
(
void
)
PyDict_SetItemString
(
d
,
"CHROMA_THRESHOLD"
,
newintobject
(
CL_CHROMA_THRESHOLD
));
PyInt_FromLong
(
CL_CHROMA_THRESHOLD
));
(
void
)
dictinsert
(
d
,
"EDGE_THRESHOLD"
,
(
void
)
PyDict_SetItemString
(
d
,
"EDGE_THRESHOLD"
,
newintobject
(
CL_EDGE_THRESHOLD
));
PyInt_FromLong
(
CL_EDGE_THRESHOLD
));
(
void
)
dictinsert
(
d
,
"BLENDING"
,
newintobject
(
CL_BLENDING
));
(
void
)
PyDict_SetItemString
(
d
,
"BLENDING"
,
(
void
)
dictinsert
(
d
,
"QUALITY_FACTOR"
,
PyInt_FromLong
(
CL_BLENDING
));
newintobject
(
CL_QUALITY_FACTOR
));
(
void
)
PyDict_SetItemString
(
d
,
"QUALITY_FACTOR"
,
(
void
)
dictinsert
(
d
,
"STREAM_HEADERS"
,
PyInt_FromLong
(
CL_QUALITY_FACTOR
));
newintobject
(
CL_STREAM_HEADERS
));
(
void
)
PyDict_SetItemString
(
d
,
"STREAM_HEADERS"
,
(
void
)
dictinsert
(
d
,
"QUALITY_LEVEL"
,
newintobject
(
CL_QUALITY_LEVEL
));
PyInt_FromLong
(
CL_STREAM_HEADERS
));
(
void
)
dictinsert
(
d
,
"TILE_THRESHOLD"
,
(
void
)
PyDict_SetItemString
(
d
,
"QUALITY_LEVEL"
,
newintobject
(
CL_TILE_THRESHOLD
));
PyInt_FromLong
(
CL_QUALITY_LEVEL
));
(
void
)
dictinsert
(
d
,
"SAMPLES_PER_TILE"
,
(
void
)
PyDict_SetItemString
(
d
,
"TILE_THRESHOLD"
,
newintobject
(
CL_SAMPLES_PER_TILE
));
PyInt_FromLong
(
CL_TILE_THRESHOLD
));
(
void
)
PyDict_SetItemString
(
d
,
"SAMPLES_PER_TILE"
,
PyInt_FromLong
(
CL_SAMPLES_PER_TILE
));
#endif
#endif
if
(
err_o
ccurred
())
if
(
PyErr_O
ccurred
())
fatal
(
"can't initialize module cl"
);
Py_FatalError
(
"can't initialize module cl"
);
(
void
)
clSetErrorHandler
(
cl_ErrorHandler
);
(
void
)
clSetErrorHandler
(
cl_ErrorHandler
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment