annotate Sources/Autogenerated/sdk_OrthancPluginImage.impl.h @ 105:912cbabbe427

revert to sdk 1.8.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Feb 2022 11:15:47 +0100
parents eb6ac5a801d1
children 65ec5597ec70 5643e97d9367
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
101
eb6ac5a801d1 update to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
3 * Copyright (C) 2020-2022 Osimis S.A., Belgium
eb6ac5a801d1 update to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
4 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * 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
7 * 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
8 * 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
9 * the License, or (at your option) any later version.
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * 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
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * Affero General Public License for more details.
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 *
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * 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
17 * 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
18 **/
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
21 // Forward declaration of the autogenerated methods
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 sdk_OrthancPluginImage_Object* self, PyObject *args);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 sdk_OrthancPluginImage_Object* self, PyObject *args);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 sdk_OrthancPluginImage_Object* self, PyObject *args);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 sdk_OrthancPluginImage_Object* self, PyObject *args);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 sdk_OrthancPluginImage_Object* self, PyObject *args);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 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
34 // 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
35
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
36
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
37 // 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
38 extern PyObject *GetImageBuffer(
4da5ce3468b4 new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
39 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
40 // End of forward declarations
1
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 static PyMethodDef sdk_OrthancPluginImage_Methods[] = {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 { "GetImagePixelFormat",
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 "Generated from C function OrthancPluginGetImagePixelFormat()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 { "GetImageWidth",
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImageWidth, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 "Generated from C function OrthancPluginGetImageWidth()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 { "GetImageHeight",
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImageHeight, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 "Generated from C function OrthancPluginGetImageHeight()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 { "GetImagePitch",
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImagePitch, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 "Generated from C function OrthancPluginGetImagePitch()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 { "ConvertPixelFormat",
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 "Generated from C function OrthancPluginConvertPixelFormat()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 { "DrawText",
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 (PyCFunction) sdk_OrthancPluginImage_OrthancPluginDrawText, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 "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
62 { "GetImageBuffer",
4da5ce3468b4 new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
63 (PyCFunction) GetImageBuffer, METH_VARARGS,
4da5ce3468b4 new wrapped functions: CreateImageFromBuffer(), DicomInstance.GetInstanceData() and Image.GetImageBuffer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
64 "Generated from C function OrthancPluginGetImageBuffer()" },
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 { NULL } /* Sentinel */
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 static int sdk_OrthancPluginImage_Constructor(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 sdk_OrthancPluginImage_Object *self, PyObject *args, PyObject *kwds)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
72 PythonLock::LogCall("Creating Python object of class OrthancPluginImage");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 self->object_ = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 self->borrowed_ = false;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 long long object = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 unsigned char borrowed = false;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 if (PyArg_ParseTuple(args, "Lb", &object, &borrowed))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 self->object_ = reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(object));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 self->borrowed_ = borrowed;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 return 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 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
89 return -1;
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 /**
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 * Static global structure => the fields that are beyond the last
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 * initialized field are set to zero.
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 * https://stackoverflow.com/a/11152199/881731
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 **/
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 static PyTypeObject sdk_OrthancPluginImage_Type = {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 PyVarObject_HEAD_INIT(NULL, 0)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 "orthanc.Image", /* tp_name */
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 sizeof(sdk_OrthancPluginImage_Object), /* tp_basicsize */
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 static void sdk_OrthancPluginImage_Destructor(PyObject *self)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
108 PythonLock::LogCall("Destroying Python object of class OrthancPluginImage");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 sdk_OrthancPluginImage_Object& tmp = *((sdk_OrthancPluginImage_Object*) self);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 if (tmp.object_ != NULL &&
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 !tmp.borrowed_)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 OrthancPluginFreeImage(OrthancPlugins::GetGlobalContext(), tmp.object_);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 tmp.object_ = NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 Py_TYPE(self)->tp_free((PyObject *)self);
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 // Actual implementation of the methods
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 sdk_OrthancPluginImage_Object* self, PyObject *args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
127 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
128
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 if (self->object_ == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 PyErr_SetString(PyExc_ValueError, "Invalid object");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 return NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 OrthancPluginPixelFormat value = OrthancPluginGetImagePixelFormat(OrthancPlugins::GetGlobalContext(), self->object_);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 return PyLong_FromLong(value);
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 sdk_OrthancPluginImage_Object* self, PyObject *args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
144 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
145
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 if (self->object_ == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 PyErr_SetString(PyExc_ValueError, "Invalid object");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 return NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 long value = OrthancPluginGetImageWidth(OrthancPlugins::GetGlobalContext(), self->object_);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 return PyLong_FromLong(value);
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 sdk_OrthancPluginImage_Object* self, PyObject *args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
161 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
162
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 if (self->object_ == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 PyErr_SetString(PyExc_ValueError, "Invalid object");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 return NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 long value = OrthancPluginGetImageHeight(OrthancPlugins::GetGlobalContext(), self->object_);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 return PyLong_FromLong(value);
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 sdk_OrthancPluginImage_Object* self, PyObject *args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
178 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
179
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 if (self->object_ == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 PyErr_SetString(PyExc_ValueError, "Invalid object");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 return NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 long value = OrthancPluginGetImagePitch(OrthancPlugins::GetGlobalContext(), self->object_);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 return PyLong_FromLong(value);
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 sdk_OrthancPluginImage_Object* self, PyObject *args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
195 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
196
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 if (self->object_ == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 PyErr_SetString(PyExc_ValueError, "Invalid object");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 return NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 if (!PyArg_ParseTuple(args, "l", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 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
208 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 // This is the case of a constructor
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 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
212
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 if (obj == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 65
diff changeset
215 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 Py_DECREF(argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 return python;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText(
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 sdk_OrthancPluginImage_Object* self, PyObject *args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
230 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
231
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 if (self->object_ == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 PyErr_SetString(PyExc_ValueError, "Invalid object");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 return NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 unsigned long arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 const char* arg1 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 long int arg3 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 unsigned char arg4 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 unsigned char arg5 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 unsigned char arg6 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 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
247 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 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
249 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 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
252
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 65
diff changeset
261 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 return NULL;
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 static void RegisterOrthancPluginImageClass(PyObject* module)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 sdk_OrthancPluginImage_Type.tp_new = PyType_GenericNew;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 sdk_OrthancPluginImage_Type.tp_flags = Py_TPFLAGS_DEFAULT;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 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
273 sdk_OrthancPluginImage_Type.tp_methods = sdk_OrthancPluginImage_Methods;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 sdk_OrthancPluginImage_Type.tp_init = (initproc) sdk_OrthancPluginImage_Constructor;
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 /**
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 * "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
278 * 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
279 * 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
280 * calling tp_free."
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 * https://stackoverflow.com/a/24863227/881731
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 **/
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 sdk_OrthancPluginImage_Type.tp_dealloc = sdk_OrthancPluginImage_Destructor;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 if (PyType_Ready(&sdk_OrthancPluginImage_Type) < 0)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 OrthancPlugins::LogError("Cannot register Python class: OrthancPluginImage");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError);
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 Py_INCREF(&sdk_OrthancPluginImage_Type);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 if (PyModule_AddObject(module, "Image", (PyObject *)&sdk_OrthancPluginImage_Type) < 0)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 OrthancPlugins::LogError("Cannot register Python class: OrthancPluginImage");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 Py_DECREF(&sdk_OrthancPluginImage_Type);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError);
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
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
301 PyTypeObject* GetOrthancPluginImageType()
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 {
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
303 return &sdk_OrthancPluginImage_Type;
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 }