[babl/wip/pippin/inverted-cmyk: 10/11] babl-space: improve initializiation of sRGB data in cmyk spaces
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl/wip/pippin/inverted-cmyk: 10/11] babl-space: improve initializiation of sRGB data in cmyk spaces
- Date: Fri, 16 Nov 2018 20:52:31 +0000 (UTC)
commit 691521f5399d63b2ebbbd0107ea1b131b9d6dff8
Author: Øyvind Kolås <pippin gimp org>
Date: Fri Nov 16 01:51:02 2018 +0100
babl-space: improve initializiation of sRGB data in cmyk spaces
babl/babl-space.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/babl/babl-space.c b/babl/babl-space.c
index 4872f3d..fcadc8c 100644
--- a/babl/babl-space.c
+++ b/babl/babl-space.c
@@ -224,8 +224,7 @@ _babl_space_for_lcms (const char *icc_data, int icc_length)
{
int i=0;
BablSpace space;
- space.instance.class_type = BABL_SPACE;
- space.instance.id = 0;
+
for (i = 0; space_db[i].instance.class_type; i++)
{
@@ -236,6 +235,11 @@ _babl_space_for_lcms (const char *icc_data, int icc_length)
return (void*)&space_db[i];
}
}
+
+ memset (&space, 0, sizeof(space));
+ space.instance.class_type = BABL_SPACE;
+ space.instance.id = 0;
+
if (i >= MAX_SPACES-1)
{
babl_log ("too many BablSpaces");
@@ -243,10 +247,9 @@ _babl_space_for_lcms (const char *icc_data, int icc_length)
}
/* initialize it with copy of srgb content */
- {
+ if(1){
const BablSpace *srgb = &babl_space("sRGB")->space;
- BablSpace *space=&space_db[i];
- memcpy (&space->xw,
+ memcpy (&space.xw,
&srgb->xw,
((char*)&srgb->icc_profile -
(char*)&srgb->xw));
@@ -1066,7 +1069,8 @@ const Babl *babl_space_match_trc_matrix (const Babl *trc_red,
for (i = 0; space_db[i].instance.class_type; i++)
{
BablSpace *space = &space_db[i];
- if (trc_red == space->trc[0] &&
+ if (space->cmyk.is_cmyk == 0 &&
+ trc_red == space->trc[0] &&
trc_green == space->trc[1] &&
trc_blue == space->trc[2] &&
fabs(rx - space->RGBtoXYZ[0]) < delta &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]