Mercurial > hg > orthanc-python
annotate Sources/Autogenerated/sdk_OrthancPluginImage.impl.h @ 77:e7ff5efb100d
Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Aug 2021 18:16:42 +0200 |
parents | cbfc72a53970 |
children | eb6ac5a801d1 |
rev | line source |
---|---|
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Python plugin for Orthanc |
56
23f3099bed47
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
28
diff
changeset
|
3 * Copyright (C) 2020-2021 Osimis S.A., Belgium |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * This program is free software: you can redistribute it and/or |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * modify it under the terms of the GNU Affero General Public License |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * as published by the Free Software Foundation, either version 3 of |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * the License, or (at your option) any later version. |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, but |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * WITHOUT ANY WARRANTY; without even the implied warranty of |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * Affero General Public License for more details. |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU Affero General Public License |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 **/ |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 |
63
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
20 // Forward declaration of the autogenerated methods |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 sdk_OrthancPluginImage_Object* self, PyObject *args); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 sdk_OrthancPluginImage_Object* self, PyObject *args); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 sdk_OrthancPluginImage_Object* self, PyObject *args); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 sdk_OrthancPluginImage_Object* self, PyObject *args); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 sdk_OrthancPluginImage_Object* self, PyObject *args); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 sdk_OrthancPluginImage_Object* self, PyObject *args); |
63
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
33 // End of forward declarations |
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
34 |
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
35 |
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
36 // Forward declaration of the custom methods |
65
4da5ce3468b4
new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
37 extern PyObject *GetImageBuffer( |
4da5ce3468b4
new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
38 sdk_OrthancPluginImage_Object* self, PyObject *args); |
63
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
39 // End of forward declarations |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 static PyMethodDef sdk_OrthancPluginImage_Methods[] = { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 { "GetImagePixelFormat", |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat, METH_VARARGS, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 "Generated from C function OrthancPluginGetImagePixelFormat()" }, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 { "GetImageWidth", |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImageWidth, METH_VARARGS, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 "Generated from C function OrthancPluginGetImageWidth()" }, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 { "GetImageHeight", |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImageHeight, METH_VARARGS, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 "Generated from C function OrthancPluginGetImageHeight()" }, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 { "GetImagePitch", |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImagePitch, METH_VARARGS, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 "Generated from C function OrthancPluginGetImagePitch()" }, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 { "ConvertPixelFormat", |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat, METH_VARARGS, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 "Generated from C function OrthancPluginConvertPixelFormat()" }, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 { "DrawText", |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginDrawText, METH_VARARGS, |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 "Generated from C function OrthancPluginDrawText()" }, |
65
4da5ce3468b4
new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
61 { "GetImageBuffer", |
4da5ce3468b4
new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
62 (PyCFunction) GetImageBuffer, METH_VARARGS, |
4da5ce3468b4
new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
63 "Generated from C function OrthancPluginGetImageBuffer()" }, |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 { NULL } /* Sentinel */ |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 }; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 static int sdk_OrthancPluginImage_Constructor( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 sdk_OrthancPluginImage_Object *self, PyObject *args, PyObject *kwds) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
71 PythonLock::LogCall("Creating Python object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 self->object_ = NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 self->borrowed_ = false; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 long long object = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 unsigned char borrowed = false; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 self->object_ = reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(object)); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 self->borrowed_ = borrowed; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 return 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 else |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 return -1; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 /** |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 * Static global structure => the fields that are beyond the last |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 * initialized field are set to zero. |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 * https://stackoverflow.com/a/11152199/881731 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 **/ |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 static PyTypeObject sdk_OrthancPluginImage_Type = { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 PyVarObject_HEAD_INIT(NULL, 0) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 "orthanc.Image", /* tp_name */ |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 sizeof(sdk_OrthancPluginImage_Object), /* tp_basicsize */ |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 }; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 static void sdk_OrthancPluginImage_Destructor(PyObject *self) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
107 PythonLock::LogCall("Destroying Python object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 sdk_OrthancPluginImage_Object& tmp = *((sdk_OrthancPluginImage_Object*) self); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 if (tmp.object_ != NULL && |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 !tmp.borrowed_) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 OrthancPluginFreeImage(OrthancPlugins::GetGlobalContext(), tmp.object_); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 tmp.object_ = NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 Py_TYPE(self)->tp_free((PyObject *)self); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 // Actual implementation of the methods |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 sdk_OrthancPluginImage_Object* self, PyObject *args) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
126 PythonLock::LogCall("Calling method OrthancPluginGetImagePixelFormat() on object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 if (self->object_ == NULL) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 OrthancPluginPixelFormat value = OrthancPluginGetImagePixelFormat(OrthancPlugins::GetGlobalContext(), self->object_); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 return PyLong_FromLong(value); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 sdk_OrthancPluginImage_Object* self, PyObject *args) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
143 PythonLock::LogCall("Calling method OrthancPluginGetImageWidth() on object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 if (self->object_ == NULL) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 long value = OrthancPluginGetImageWidth(OrthancPlugins::GetGlobalContext(), self->object_); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 return PyLong_FromLong(value); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 sdk_OrthancPluginImage_Object* self, PyObject *args) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
160 PythonLock::LogCall("Calling method OrthancPluginGetImageHeight() on object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 if (self->object_ == NULL) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 long value = OrthancPluginGetImageHeight(OrthancPlugins::GetGlobalContext(), self->object_); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 return PyLong_FromLong(value); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 sdk_OrthancPluginImage_Object* self, PyObject *args) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
177 PythonLock::LogCall("Calling method OrthancPluginGetImagePitch() on object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 if (self->object_ == NULL) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 long value = OrthancPluginGetImagePitch(OrthancPlugins::GetGlobalContext(), self->object_); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 return PyLong_FromLong(value); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 sdk_OrthancPluginImage_Object* self, PyObject *args) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
194 PythonLock::LogCall("Calling method OrthancPluginConvertPixelFormat() on object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 if (self->object_ == NULL) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 long int arg0 = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 if (!PyArg_ParseTuple(args, "l", &arg0)) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 // This is the case of a constructor |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 OrthancPluginImage* obj = OrthancPluginConvertPixelFormat(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0)); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 if (obj == NULL) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 { |
75
cbfc72a53970
refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
65
diff
changeset
|
214 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 else |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
221 Py_DECREF(argList); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
222 return python; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
225 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText( |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 sdk_OrthancPluginImage_Object* self, PyObject *args) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 { |
28
b2bbb516056e
The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
229 PythonLock::LogCall("Calling method OrthancPluginDrawText() on object of class OrthancPluginImage"); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 if (self->object_ == NULL) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 unsigned long arg0 = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 const char* arg1 = NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 long int arg2 = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 long int arg3 = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 unsigned char arg4 = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 unsigned char arg5 = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 unsigned char arg6 = 0; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 if (!PyArg_ParseTuple(args, "ksllbbb", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6)) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 OrthancPluginErrorCode code = OrthancPluginDrawText(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 if (code == OrthancPluginErrorCode_Success) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 Py_INCREF(Py_None); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 return Py_None; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 else |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 { |
75
cbfc72a53970
refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
65
diff
changeset
|
260 PythonLock::RaiseException(code); |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 return NULL; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 static void RegisterOrthancPluginImageClass(PyObject* module) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 sdk_OrthancPluginImage_Type.tp_new = PyType_GenericNew; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 sdk_OrthancPluginImage_Type.tp_flags = Py_TPFLAGS_DEFAULT; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 sdk_OrthancPluginImage_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginImage"; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 sdk_OrthancPluginImage_Type.tp_methods = sdk_OrthancPluginImage_Methods; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 sdk_OrthancPluginImage_Type.tp_init = (initproc) sdk_OrthancPluginImage_Constructor; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 /** |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 * "tp_dealloc is called when the reference count of the object goes |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
277 * down to zero. This is where you destroy the object and its |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 * members. It should then free the memory occupied by the object by |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 * calling tp_free." |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
280 * https://stackoverflow.com/a/24863227/881731 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
281 **/ |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
282 sdk_OrthancPluginImage_Type.tp_dealloc = sdk_OrthancPluginImage_Destructor; |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
283 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
284 if (PyType_Ready(&sdk_OrthancPluginImage_Type) < 0) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
285 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
286 OrthancPlugins::LogError("Cannot register Python class: OrthancPluginImage"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
287 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
288 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
289 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
290 Py_INCREF(&sdk_OrthancPluginImage_Type); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
291 if (PyModule_AddObject(module, "Image", (PyObject *)&sdk_OrthancPluginImage_Type) < 0) |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
292 { |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 OrthancPlugins::LogError("Cannot register Python class: OrthancPluginImage"); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
294 Py_DECREF(&sdk_OrthancPluginImage_Type); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
295 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
296 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 } |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 |
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
299 |
63
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
300 PyTypeObject* GetOrthancPluginImageType() |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
301 { |
63
32de70a1e4c7
New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
302 return &sdk_OrthancPluginImage_Type; |
1
fef9a239df5c
adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
303 } |