@@ -181,17 +181,15 @@ cms_profile_dealloc(CmsProfileObject *self) {
181
181
/* a transform represents the mapping between two profiles */
182
182
183
183
typedef struct {
184
- PyObject_HEAD char mode_in [8 ];
185
- char mode_out [8 ];
186
- cmsHTRANSFORM transform ;
184
+ PyObject_HEAD cmsHTRANSFORM transform ;
187
185
} CmsTransformObject ;
188
186
189
187
static PyTypeObject CmsTransform_Type ;
190
188
191
189
#define CmsTransform_Check (op ) (Py_TYPE(op) == &CmsTransform_Type)
192
190
193
191
static PyObject *
194
- cms_transform_new (cmsHTRANSFORM transform , char * mode_in , char * mode_out ) {
192
+ cms_transform_new (cmsHTRANSFORM transform ) {
195
193
CmsTransformObject * self ;
196
194
197
195
self = PyObject_New (CmsTransformObject , & CmsTransform_Type );
@@ -201,9 +199,6 @@ cms_transform_new(cmsHTRANSFORM transform, char *mode_in, char *mode_out) {
201
199
202
200
self -> transform = transform ;
203
201
204
- strncpy (self -> mode_in , mode_in , 8 );
205
- strncpy (self -> mode_out , mode_out , 8 );
206
-
207
202
return (PyObject * )self ;
208
203
}
209
204
@@ -395,7 +390,7 @@ _buildTransform(
395
390
396
391
Py_END_ALLOW_THREADS
397
392
398
- if (!hTransform ) {
393
+ if (!hTransform ) {
399
394
PyErr_SetString (PyExc_ValueError , "cannot build transform" );
400
395
}
401
396
@@ -429,7 +424,7 @@ _buildProofTransform(
429
424
430
425
Py_END_ALLOW_THREADS
431
426
432
- if (!hTransform ) {
427
+ if (!hTransform ) {
433
428
PyErr_SetString (PyExc_ValueError , "cannot build proof transform" );
434
429
}
435
430
@@ -476,7 +471,7 @@ buildTransform(PyObject *self, PyObject *args) {
476
471
return NULL ;
477
472
}
478
473
479
- return cms_transform_new (transform , sInMode , sOutMode );
474
+ return cms_transform_new (transform );
480
475
}
481
476
482
477
static PyObject *
@@ -523,7 +518,7 @@ buildProofTransform(PyObject *self, PyObject *args) {
523
518
return NULL ;
524
519
}
525
520
526
- return cms_transform_new (transform , sInMode , sOutMode );
521
+ return cms_transform_new (transform );
527
522
}
528
523
529
524
static PyObject *
@@ -1456,21 +1451,6 @@ static struct PyMethodDef cms_transform_methods[] = {
1456
1451
{"apply" , (PyCFunction )cms_transform_apply , 1 }, {NULL , NULL } /* sentinel */
1457
1452
};
1458
1453
1459
- static PyObject *
1460
- cms_transform_getattr_inputMode (CmsTransformObject * self , void * closure ) {
1461
- return PyUnicode_FromString (self -> mode_in );
1462
- }
1463
-
1464
- static PyObject *
1465
- cms_transform_getattr_outputMode (CmsTransformObject * self , void * closure ) {
1466
- return PyUnicode_FromString (self -> mode_out );
1467
- }
1468
-
1469
- static struct PyGetSetDef cms_transform_getsetters [] = {
1470
- {"inputMode" , (getter )cms_transform_getattr_inputMode },
1471
- {"outputMode" , (getter )cms_transform_getattr_outputMode },
1472
- {NULL }};
1473
-
1474
1454
static PyTypeObject CmsTransform_Type = {
1475
1455
PyVarObject_HEAD_INIT (NULL , 0 ) "PIL.ImageCms.core.CmsTransform" , /*tp_name*/
1476
1456
sizeof (CmsTransformObject ), /*tp_basicsize*/
@@ -1501,7 +1481,7 @@ static PyTypeObject CmsTransform_Type = {
1501
1481
0 , /*tp_iternext*/
1502
1482
cms_transform_methods , /*tp_methods*/
1503
1483
0 , /*tp_members*/
1504
- cms_transform_getsetters , /*tp_getset*/
1484
+ 0 , /*tp_getset*/
1505
1485
};
1506
1486
1507
1487
static int
0 commit comments