Convert tabs to spaces

This commit is contained in:
Hugo 2019-01-28 08:39:18 +02:00
parent 071dc9409f
commit 80f69ad32e

View File

@ -735,12 +735,12 @@ _xyz3_py(cmsCIEXYZ* XYZ)
cmsXYZ2xyY(&xyY[2], &XYZ[2]); cmsXYZ2xyY(&xyY[2], &XYZ[2]);
return Py_BuildValue("(((d,d,d),(d,d,d),(d,d,d)),((d,d,d),(d,d,d),(d,d,d)))", return Py_BuildValue("(((d,d,d),(d,d,d),(d,d,d)),((d,d,d),(d,d,d),(d,d,d)))",
XYZ[0].X, XYZ[0].Y, XYZ[0].Z, XYZ[0].X, XYZ[0].Y, XYZ[0].Z,
XYZ[1].X, XYZ[1].Y, XYZ[1].Z, XYZ[1].X, XYZ[1].Y, XYZ[1].Z,
XYZ[2].X, XYZ[2].Y, XYZ[2].Z, XYZ[2].X, XYZ[2].Y, XYZ[2].Z,
xyY[0].x, xyY[0].y, xyY[0].Y, xyY[0].x, xyY[0].y, xyY[0].Y,
xyY[1].x, xyY[1].y, xyY[1].Y, xyY[1].x, xyY[1].y, xyY[1].Y,
xyY[2].x, xyY[2].y, xyY[2].Y); xyY[2].x, xyY[2].y, xyY[2].Y);
} }
static PyObject* static PyObject*
@ -783,9 +783,9 @@ _profile_read_ciexyy_triple(CmsProfileObject* self, cmsTagSignature info)
/* Note: lcms does all the heavy lifting and error checking (nr of /* Note: lcms does all the heavy lifting and error checking (nr of
channels == 3). */ channels == 3). */
return Py_BuildValue("((d,d,d),(d,d,d),(d,d,d)),", return Py_BuildValue("((d,d,d),(d,d,d),(d,d,d)),",
triple->Red.x, triple->Red.y, triple->Red.Y, triple->Red.x, triple->Red.y, triple->Red.Y,
triple->Green.x, triple->Green.y, triple->Green.Y, triple->Green.x, triple->Green.y, triple->Green.Y,
triple->Blue.x, triple->Blue.y, triple->Blue.Y); triple->Blue.x, triple->Blue.y, triple->Blue.Y);
} }
static PyObject* static PyObject*
@ -817,12 +817,12 @@ _profile_read_named_color_list(CmsProfileObject* self, cmsTagSignature info)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
PyObject* str; PyObject* str;
cmsNamedColorInfo(ncl, i, name, NULL, NULL, NULL, NULL); cmsNamedColorInfo(ncl, i, name, NULL, NULL, NULL, NULL);
str = PyUnicode_FromString(name); str = PyUnicode_FromString(name);
if (str == NULL) { if (str == NULL) {
Py_DECREF(result); Py_DECREF(result);
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
PyList_SET_ITEM(result, i, str); PyList_SET_ITEM(result, i, str);
} }
@ -844,9 +844,9 @@ static cmsBool _calculate_rgb_primaries(CmsProfileObject* self, cmsCIEXYZTRIPLE*
// transform from our profile to XYZ using doubles for highest precision // transform from our profile to XYZ using doubles for highest precision
hTransform = cmsCreateTransform(self->profile, TYPE_RGB_DBL, hTransform = cmsCreateTransform(self->profile, TYPE_RGB_DBL,
hXYZ, TYPE_XYZ_DBL, hXYZ, TYPE_XYZ_DBL,
INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC,
cmsFLAGS_NOCACHE | cmsFLAGS_NOOPTIMIZE); cmsFLAGS_NOCACHE | cmsFLAGS_NOOPTIMIZE);
cmsCloseProfile(hXYZ); cmsCloseProfile(hXYZ);
if (hTransform == NULL) if (hTransform == NULL)
return 0; return 0;
@ -885,31 +885,31 @@ _is_intent_supported(CmsProfileObject* self, int clut)
n = cmsGetSupportedIntents(INTENTS, n = cmsGetSupportedIntents(INTENTS,
intent_ids, intent_ids,
intent_descs); intent_descs);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
int intent = (int) intent_ids[i]; int intent = (int) intent_ids[i];
PyObject* id; PyObject* id;
PyObject* entry; PyObject* entry;
/* Only valid for ICC Intents (otherwise we read invalid memory in lcms cmsio1.c). */ /* Only valid for ICC Intents (otherwise we read invalid memory in lcms cmsio1.c). */
if (!(intent == INTENT_PERCEPTUAL || intent == INTENT_RELATIVE_COLORIMETRIC if (!(intent == INTENT_PERCEPTUAL || intent == INTENT_RELATIVE_COLORIMETRIC
|| intent == INTENT_SATURATION || intent == INTENT_ABSOLUTE_COLORIMETRIC)) || intent == INTENT_SATURATION || intent == INTENT_ABSOLUTE_COLORIMETRIC))
continue; continue;
id = PyInt_FromLong((long) intent); id = PyInt_FromLong((long) intent);
entry = Py_BuildValue("(OOO)", entry = Py_BuildValue("(OOO)",
_check_intent(clut, self->profile, intent, LCMS_USED_AS_INPUT) ? Py_True : Py_False, _check_intent(clut, self->profile, intent, LCMS_USED_AS_INPUT) ? Py_True : Py_False,
_check_intent(clut, self->profile, intent, LCMS_USED_AS_OUTPUT) ? Py_True : Py_False, _check_intent(clut, self->profile, intent, LCMS_USED_AS_OUTPUT) ? Py_True : Py_False,
_check_intent(clut, self->profile, intent, LCMS_USED_AS_PROOF) ? Py_True : Py_False); _check_intent(clut, self->profile, intent, LCMS_USED_AS_PROOF) ? Py_True : Py_False);
if (id == NULL || entry == NULL) { if (id == NULL || entry == NULL) {
Py_XDECREF(id); Py_XDECREF(id);
Py_XDECREF(entry); Py_XDECREF(entry);
Py_XDECREF(result); Py_XDECREF(result);
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
PyDict_SetItem(result, id, entry); PyDict_SetItem(result, id, entry);
} }
return result; return result;
} }
@ -1070,7 +1070,7 @@ cms_profile_getattr_creation_date(CmsProfileObject* self, void* closure)
} }
return PyDateTime_FromDateAndTime(1900 + ct.tm_year, ct.tm_mon, ct.tm_mday, return PyDateTime_FromDateAndTime(1900 + ct.tm_year, ct.tm_mon, ct.tm_mday,
ct.tm_hour, ct.tm_min, ct.tm_sec, 0); ct.tm_hour, ct.tm_min, ct.tm_sec, 0);
} }
static PyObject* static PyObject*
@ -1295,7 +1295,7 @@ cms_profile_getattr_green_primary(CmsProfileObject* self, void* closure)
result = _calculate_rgb_primaries(self, &primaries); result = _calculate_rgb_primaries(self, &primaries);
if (! result) { if (! result) {
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
return _xyz_py(&primaries.Green); return _xyz_py(&primaries.Green);
@ -1311,7 +1311,7 @@ cms_profile_getattr_blue_primary(CmsProfileObject* self, void* closure)
result = _calculate_rgb_primaries(self, &primaries); result = _calculate_rgb_primaries(self, &primaries);
if (! result) { if (! result) {
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
return _xyz_py(&primaries.Blue); return _xyz_py(&primaries.Blue);
@ -1394,11 +1394,11 @@ cms_profile_getattr_icc_measurement_condition (CmsProfileObject* self, void* clo
geo = "unknown"; geo = "unknown";
return Py_BuildValue("{s:i,s:(ddd),s:s,s:d,s:s}", return Py_BuildValue("{s:i,s:(ddd),s:s,s:d,s:s}",
"observer", mc->Observer, "observer", mc->Observer,
"backing", mc->Backing.X, mc->Backing.Y, mc->Backing.Z, "backing", mc->Backing.X, mc->Backing.Y, mc->Backing.Z,
"geo", geo, "geo", geo,
"flare", mc->Flare, "flare", mc->Flare,
"illuminant_type", _illu_map(mc->IlluminantType)); "illuminant_type", _illu_map(mc->IlluminantType));
} }
static PyObject* static PyObject*
@ -1419,9 +1419,9 @@ cms_profile_getattr_icc_viewing_condition (CmsProfileObject* self, void* closure
} }
return Py_BuildValue("{s:(ddd),s:(ddd),s:s}", return Py_BuildValue("{s:(ddd),s:(ddd),s:s}",
"illuminant", vc->IlluminantXYZ.X, vc->IlluminantXYZ.Y, vc->IlluminantXYZ.Z, "illuminant", vc->IlluminantXYZ.X, vc->IlluminantXYZ.Y, vc->IlluminantXYZ.Z,
"surround", vc->SurroundXYZ.X, vc->SurroundXYZ.Y, vc->SurroundXYZ.Z, "surround", vc->SurroundXYZ.X, vc->SurroundXYZ.Y, vc->SurroundXYZ.Z,
"illuminant_type", _illu_map(vc->IlluminantType)); "illuminant_type", _illu_map(vc->IlluminantType));
} }