diff options
author | Benoit Girard <mozilla@wavicle-2.local> | 2010-08-01 18:45:13 -0400 |
---|---|---|
committer | Benoit Girard <mozilla@wavicle-2.local> | 2010-08-01 18:45:13 -0400 |
commit | f2c9535d0b1613eaa6720c86ebab7a92f72fa59a (patch) | |
tree | 5a2bd1fc94e165a600b6b39ecfc4af0cd99679fe | |
parent | bc4eafb77a3479532ab0ef968c0287a8aea9b3c2 (diff) |
Review comments: Explained 33 sample size, rename xyz to pcs in some places, fix spelling
-rw-r--r-- | chain.c | 39 | ||||
-rw-r--r-- | transform.c | 5 |
2 files changed, 25 insertions, 19 deletions
@@ -837,7 +837,7 @@ fail: } /* Not Completed -// Simply the transformation chain an equivilent transformation chain +// Simplify the transformation chain to an equivalent transformation chain static struct qcms_modular_transform* qcms_modular_transform_reduce(struct qcms_modular_transform *transform) { struct qcms_modular_transform *first_transform = NULL; @@ -894,25 +894,26 @@ static struct qcms_modular_transform* qcms_modular_transform_create(qcms_profile struct qcms_modular_transform **next_transform = &first_transform; if (in->color_space == RGB_SIGNATURE) { - struct qcms_modular_transform* rgb_to_xyz; - rgb_to_xyz = qcms_modular_transform_create_input(in); - if (!rgb_to_xyz) + struct qcms_modular_transform* rgb_to_pcs; + rgb_to_pcs = qcms_modular_transform_create_input(in); + if (!rgb_to_pcs) goto fail; - append_transform(rgb_to_xyz, &next_transform); + append_transform(rgb_to_pcs, &next_transform); } else { assert(0 && "input color space not supported"); goto fail; } if (in->pcs == LAB_SIGNATURE && out->pcs == XYZ_SIGNATURE) { - struct qcms_modular_transform* lab_to_xyz; - lab_to_xyz = qcms_modular_transform_alloc(); - if (!lab_to_xyz) + struct qcms_modular_transform* lab_to_pcs; + lab_to_pcs = qcms_modular_transform_alloc(); + if (!lab_to_pcs) goto fail; - append_transform(lab_to_xyz, &next_transform); - lab_to_xyz->transform_module_fn = qcms_transform_module_LAB_to_XYZ; + append_transform(lab_to_pcs, &next_transform); + lab_to_pcs->transform_module_fn = qcms_transform_module_LAB_to_XYZ; } + // This does not improve accuracy in practice, something is wrong here. //if (in->chromaticAdaption.invalid == false) { // struct qcms_modular_transform* chromaticAdaption; // chromaticAdaption = qcms_modular_transform_alloc(); @@ -924,20 +925,20 @@ static struct qcms_modular_transform* qcms_modular_transform_create(qcms_profile //} if (in->pcs == XYZ_SIGNATURE && out->pcs == LAB_SIGNATURE) { - struct qcms_modular_transform* xyz_to_lab; - xyz_to_lab = qcms_modular_transform_alloc(); - if (!xyz_to_lab) + struct qcms_modular_transform* pcs_to_lab; + pcs_to_lab = qcms_modular_transform_alloc(); + if (!pcs_to_lab) goto fail; - append_transform(xyz_to_lab, &next_transform); - xyz_to_lab->transform_module_fn = qcms_transform_module_XYZ_to_LAB; + append_transform(pcs_to_lab, &next_transform); + pcs_to_lab->transform_module_fn = qcms_transform_module_XYZ_to_LAB; } if (out->color_space == RGB_SIGNATURE) { - struct qcms_modular_transform* xyz_to_rgb; - xyz_to_rgb = qcms_modular_transform_create_output(out); - if (!xyz_to_rgb) + struct qcms_modular_transform* pcs_to_rgb; + pcs_to_rgb = qcms_modular_transform_create_output(out); + if (!pcs_to_rgb) goto fail; - append_transform(xyz_to_rgb, &next_transform); + append_transform(pcs_to_rgb, &next_transform); } else { assert(0 && "output color space not supported"); goto fail; diff --git a/transform.c b/transform.c index cded207..72e5535 100644 --- a/transform.c +++ b/transform.c @@ -1115,6 +1115,11 @@ qcms_transform* qcms_transform_create( } if (in->A2B0 || out->B2A0 || in->mAB || out->mAB) { + // Precache the transformation to a CLUT 33x33x33 in size. + // 33 is used by many profiles and works well in pratice. + // This evenly divides 256 into blocks of 8x8x8. + // TODO For transforming small data sets of about 200x200 or less + // precaching should be avoided. qcms_transform *result = qcms_transform_precacheLUT_float(transform, in, out, 33, in_type); if (!result) { assert(0 && "precacheLUT failed"); |