annotate Sources/Autogenerated/sdk_OrthancPluginImage.methods.h @ 155:71d305c29cfa

updated year to 2024
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 16 Mar 2024 11:58:51 +0100
parents 5643e97d9367
children e9be3c9294d4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
129
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 // Actual implementation of the methods
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 sdk_OrthancPluginImage_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 PythonLock::LogCall("Calling method OrthancPluginGetImagePixelFormat() on object of class OrthancPluginImage");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 OrthancPluginPixelFormat value = OrthancPluginGetImagePixelFormat(OrthancPlugins::GetGlobalContext(), self->object_);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 return PyLong_FromLong(value);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 sdk_OrthancPluginImage_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 PythonLock::LogCall("Calling method OrthancPluginGetImageWidth() on object of class OrthancPluginImage");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 long value = OrthancPluginGetImageWidth(OrthancPlugins::GetGlobalContext(), self->object_);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 return PyLong_FromLong(value);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 sdk_OrthancPluginImage_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 PythonLock::LogCall("Calling method OrthancPluginGetImageHeight() on object of class OrthancPluginImage");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 long value = OrthancPluginGetImageHeight(OrthancPlugins::GetGlobalContext(), self->object_);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 return PyLong_FromLong(value);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 sdk_OrthancPluginImage_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 PythonLock::LogCall("Calling method OrthancPluginGetImagePitch() on object of class OrthancPluginImage");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 long value = OrthancPluginGetImagePitch(OrthancPlugins::GetGlobalContext(), self->object_);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 return PyLong_FromLong(value);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 sdk_OrthancPluginImage_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 PythonLock::LogCall("Calling method OrthancPluginConvertPixelFormat() on object of class OrthancPluginImage");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 long int arg0 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 if (!PyArg_ParseTuple(args, "l", &arg0))
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 // This is the case of a constructor
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 OrthancPluginImage* obj = OrthancPluginConvertPixelFormat(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0));
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 if (obj == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 else
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 Py_DECREF(argList);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 return python;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 sdk_OrthancPluginImage_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 PythonLock::LogCall("Calling method OrthancPluginDrawText() on object of class OrthancPluginImage");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 unsigned long arg0 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 const char* arg1 = NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 long int arg2 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 long int arg3 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 unsigned char arg4 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 unsigned char arg5 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 unsigned char arg6 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 if (!PyArg_ParseTuple(args, "ksllbbb", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6))
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 OrthancPluginErrorCode code = OrthancPluginDrawText(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 if (code == OrthancPluginErrorCode_Success)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 Py_INCREF(Py_None);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 return Py_None;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 else
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 PythonLock::RaiseException(code);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143