diff options
Diffstat (limited to 'gs/base/gscscie.c')
-rw-r--r-- | gs/base/gscscie.c | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/gs/base/gscscie.c b/gs/base/gscscie.c index ce3f77e2d..80dbd59f0 100644 --- a/gs/base/gscscie.c +++ b/gs/base/gscscie.c @@ -1,6 +1,6 @@ /* Copyright (C) 2001-2006 Artifex Software, Inc. All Rights Reserved. - + This software is provided AS-IS with no warranty, either express or implied. @@ -42,7 +42,7 @@ private_st_cie_defg(); /* CIEBasedDEFG */ gs_private_st_ptrs1(st_color_space_CIEDEFG, gs_color_space, "gs_color_space(CIEDEFG)", cs_CIEDEFG_enum_ptrs, cs_CIEDEFG_reloc_ptrs, - params.defg); + params.defg); static cs_proc_final(gx_final_CIEDEFG); static cs_proc_serialize(gx_serialize_CIEDEFG); const gs_color_space_type gs_color_space_type_CIEDEFG = { @@ -61,8 +61,8 @@ const gs_color_space_type gs_color_space_type_CIEDEFG = { /* CIEBasedDEF */ gs_private_st_ptrs1(st_color_space_CIEDEF, gs_color_space, - "gs_color_space(CIEDEF)", cs_CIEDEF_enum_ptrs, cs_CIEDEF_reloc_ptrs, - params.def); + "gs_color_space(CIEDEF)", cs_CIEDEF_enum_ptrs, cs_CIEDEF_reloc_ptrs, + params.def); static cs_proc_final(gx_final_CIEDEF); static cs_proc_serialize(gx_serialize_CIEDEF); const gs_color_space_type gs_color_space_type_CIEDEF = { @@ -81,8 +81,8 @@ const gs_color_space_type gs_color_space_type_CIEDEF = { /* CIEBasedABC */ gs_private_st_ptrs1(st_color_space_CIEABC, gs_color_space, - "gs_color_space(CIEABC)", cs_CIEABC_enum_ptrs, cs_CIEABC_reloc_ptrs, - params.abc); + "gs_color_space(CIEABC)", cs_CIEABC_enum_ptrs, cs_CIEABC_reloc_ptrs, + params.abc); static cs_proc_final(gx_final_CIEABC); static cs_proc_serialize(gx_serialize_CIEABC); const gs_color_space_type gs_color_space_type_CIEABC = { @@ -100,8 +100,8 @@ const gs_color_space_type gs_color_space_type_CIEABC = { /* CIEBasedA */ gs_private_st_ptrs1(st_color_space_CIEA, gs_color_space, - "gs_color_space(CIEA)", cs_CIEA_enum_ptrs, cs_CIEA_reloc_ptrs, - params.a); + "gs_color_space(CIEA)", cs_CIEA_enum_ptrs, cs_CIEA_reloc_ptrs, + params.a); static cs_proc_final(gx_final_CIEA); static cs_proc_serialize(gx_serialize_CIEA); const gs_color_space_type gs_color_space_type_CIEA = { @@ -125,11 +125,11 @@ gx_concrete_space_CIE(const gs_color_space * pcs, const gs_imager_state * pis) const gs_cie_render *pcie = pis->cie_render; if (pcie == 0 || pcie->RenderTable.lookup.table == 0 || - pcie->RenderTable.lookup.m == 3 - ) { - return pis->devicergb_cs; + pcie->RenderTable.lookup.m == 3 + ) { + return pis->devicergb_cs; } else { /* pcie->RenderTable.lookup.m == 4 */ - return pis->devicecmyk_cs; + return pis->devicecmyk_cs; } } @@ -236,7 +236,7 @@ set_ctbl_defaults(gx_color_lookup_table * plktblp, int num_comps) plktblp->n = num_comps; plktblp->m = 3; /* always output CIE ABC */ for (i = 0; i < countof(plktblp->dims); i++) - plktblp->dims[i] = 0; + plktblp->dims[i] = 0; plktblp->table = 0; } @@ -248,21 +248,21 @@ set_ctbl_defaults(gx_color_lookup_table * plktblp, int num_comps) */ void * gx_build_cie_space(gs_color_space ** ppcspace, - const gs_color_space_type * pcstype, - gs_memory_type_ptr_t stype, gs_memory_t * pmem) + const gs_color_space_type * pcstype, + gs_memory_type_ptr_t stype, gs_memory_t * pmem) { gs_color_space *pcspace = gs_cspace_alloc(pmem, pcstype); gs_cie_common_elements_t *pdata; if (pcspace == NULL) - return NULL; + return NULL; rc_alloc_struct_1(pdata, gs_cie_common_elements_t, stype, pmem, - { - gs_free_object(pmem, pcspace, "gx_build_cie_space"); - return 0; - } - , - "gx_build_cie_space(data)"); + { + gs_free_object(pmem, pcspace, "gx_build_cie_space"); + return 0; + } + , + "gx_build_cie_space(data)"); *ppcspace = pcspace; return (void *)pdata; } @@ -271,13 +271,13 @@ gx_build_cie_space(gs_color_space ** ppcspace, int gs_cspace_build_CIEA(gs_color_space ** ppcspace, void *client_data, - gs_memory_t * pmem) + gs_memory_t * pmem) { gs_cie_a *pciea = gx_build_cie_space(ppcspace, &gs_color_space_type_CIEA, &st_cie_a, pmem); if (pciea == 0) - return_error(gs_error_VMerror); + return_error(gs_error_VMerror); gx_set_common_cie_defaults(&pciea->common, client_data); pciea->common.install_cspace = gx_install_CIEA; @@ -291,14 +291,14 @@ gs_cspace_build_CIEA(gs_color_space ** ppcspace, void *client_data, int gs_cspace_build_CIEABC(gs_color_space ** ppcspace, void *client_data, - gs_memory_t * pmem) + gs_memory_t * pmem) { gs_cie_abc *pabc = gx_build_cie_space(ppcspace, &gs_color_space_type_CIEABC, &st_cie_abc, - pmem); + pmem); if (pabc == 0) - return_error(gs_error_VMerror); + return_error(gs_error_VMerror); set_cie_abc_defaults(pabc, client_data); pabc->common.install_cspace = gx_install_CIEABC; @@ -309,14 +309,14 @@ gs_cspace_build_CIEABC(gs_color_space ** ppcspace, void *client_data, int gs_cspace_build_CIEDEF(gs_color_space ** ppcspace, void *client_data, - gs_memory_t * pmem) + gs_memory_t * pmem) { gs_cie_def *pdef = gx_build_cie_space(ppcspace, &gs_color_space_type_CIEDEF, &st_cie_def, - pmem); + pmem); if (pdef == 0) - return_error(gs_error_VMerror); + return_error(gs_error_VMerror); set_cie_abc_defaults((gs_cie_abc *) pdef, client_data); pdef->common.install_cspace = gx_install_CIEDEF; @@ -331,14 +331,14 @@ gs_cspace_build_CIEDEF(gs_color_space ** ppcspace, void *client_data, int gs_cspace_build_CIEDEFG(gs_color_space ** ppcspace, void *client_data, - gs_memory_t * pmem) + gs_memory_t * pmem) { gs_cie_defg *pdefg = gx_build_cie_space(ppcspace, &gs_color_space_type_CIEDEFG, &st_cie_defg, - pmem); + pmem); if (pdefg == 0) - return_error(gs_error_VMerror); + return_error(gs_error_VMerror); set_cie_abc_defaults((gs_cie_abc *) pdefg, client_data); pdefg->common.install_cspace = gx_install_CIEDEFG; @@ -355,20 +355,20 @@ gs_cspace_build_CIEDEFG(gs_color_space ** ppcspace, void *client_data, int gs_cie_defx_set_lookup_table(gs_color_space * pcspace, int *pdims, - const gs_const_string * ptable) + const gs_const_string * ptable) { gx_color_lookup_table *plktblp; switch (gs_color_space_get_index(pcspace)) { - case gs_color_space_index_CIEDEF: - plktblp = &pcspace->params.def->Table; - break; - case gs_color_space_index_CIEDEFG: - plktblp = &pcspace->params.defg->Table; - plktblp->dims[3] = pdims[3]; - break; - default: - return_error(gs_error_rangecheck); + case gs_color_space_index_CIEDEF: + plktblp = &pcspace->params.def->Table; + break; + case gs_color_space_index_CIEDEFG: + plktblp = &pcspace->params.defg->Table; + plktblp->dims[3] = pdims[3]; + break; + default: + return_error(gs_error_rangecheck); } plktblp->dims[0] = pdims[0]; @@ -389,14 +389,14 @@ gx_serialize_cie_cache(const cie_cache_floats *c, stream * s) code = sputs(s, (const byte *)&c->params.is_identity, sizeof(c->params.is_identity), &n); if (c->params.is_identity) - return 0; + return 0; code = sputs(s, (const byte *)&cache_size, sizeof(cache_size), &n); if (code < 0) - return code; + return code; return sputs(s, (const byte *)c->values, sizeof(c->values), &n); } -int +int gx_serialize_cie_common_elements(const gs_color_space * pcs, stream * s) { const gs_cie_a * p = pcs->params.a; @@ -404,24 +404,24 @@ gx_serialize_cie_common_elements(const gs_color_space * pcs, stream * s) int code = gx_serialize_cspace_type(pcs, s); if (code < 0) - return code; - code = sputs(s, (const byte *)&p->common.RangeLMN, - sizeof(p->common.RangeLMN), &n); + return code; + code = sputs(s, (const byte *)&p->common.RangeLMN, + sizeof(p->common.RangeLMN), &n); if (code < 0) - return code; + return code; for (k = 0; k < 3 && code >= 0; k++) - code = gx_serialize_cie_cache(&p->common.caches.DecodeLMN[k].floats, s); + code = gx_serialize_cie_cache(&p->common.caches.DecodeLMN[k].floats, s); if (code < 0) - return code; - code = sputs(s, (const byte *)&p->common.MatrixLMN, - sizeof(p->common.MatrixLMN), &n); + return code; + code = sputs(s, (const byte *)&p->common.MatrixLMN, + sizeof(p->common.MatrixLMN), &n); if (code < 0) - return code; - return sputs(s, (const byte *)&p->common.points, - sizeof(p->common.points), &n); + return code; + return sputs(s, (const byte *)&p->common.points, + sizeof(p->common.points), &n); } -static int +static int gx_serialize_CIEA(const gs_color_space * pcs, stream * s) { const gs_cie_a * p = pcs->params.a; @@ -429,17 +429,17 @@ gx_serialize_CIEA(const gs_color_space * pcs, stream * s) int code = gx_serialize_cie_common_elements(pcs, s); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&p->RangeA, sizeof(p->RangeA), &n); if (code < 0) - return code; + return code; code = gx_serialize_cie_cache(&p->caches.DecodeA.floats, s); if (code < 0) - return code; + return code; return sputs(s, (const byte *)&p->MatrixA, sizeof(p->MatrixA), &n); } -static int +static int gx_serialize_CIEABC(const gs_color_space * pcs, stream * s) { const gs_cie_abc * p = pcs->params.abc; @@ -447,43 +447,43 @@ gx_serialize_CIEABC(const gs_color_space * pcs, stream * s) int code = gx_serialize_cie_common_elements(pcs, s); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&p->RangeABC, sizeof(p->RangeABC), &n); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&p->caches.skipABC, sizeof(p->caches.skipABC), &n); if (code < 0) - return code; + return code; if (p->caches.skipABC) - return 0; + return 0; for (k = 0; k < 3 && code >= 0; k++) - code = gx_serialize_cie_cache(&p->caches.DecodeABC.caches[k].floats, s); + code = gx_serialize_cie_cache(&p->caches.DecodeABC.caches[k].floats, s); if (code < 0) - return code; + return code; return sputs(s, (const byte *)&p->MatrixABC, sizeof(p->MatrixABC), &n); } -static int +static int gx_serialize_lookup_table(const gx_color_lookup_table * t, stream * s) { uint n; int code = sputs(s, (const byte *)&t->n, sizeof(t->n), &n); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&t->dims[0], sizeof(t->dims[0]) * t->n, &n); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&t->m, sizeof(t->m), &n); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&t->table->size, sizeof(t->table->size), &n); if (code < 0) - return code; + return code; return sputs(s, (const byte *)&t->table->data, t->table->size, &n); } -static int +static int gx_serialize_CIEDEF(const gs_color_space * pcs, stream * s) { const gs_cie_def * p = pcs->params.def; @@ -491,21 +491,21 @@ gx_serialize_CIEDEF(const gs_color_space * pcs, stream * s) int code = gx_serialize_cie_common_elements(pcs, s); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&p->RangeDEF, sizeof(p->RangeDEF), &n); if (code < 0) - return code; + return code; for (k = 0; k < 3 && code >= 0; k++) - code = gx_serialize_cie_cache(&p->caches_def.DecodeDEF[k].floats, s); + code = gx_serialize_cie_cache(&p->caches_def.DecodeDEF[k].floats, s); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&p->RangeHIJ, sizeof(p->RangeHIJ), &n); if (code < 0) - return code; + return code; return gx_serialize_lookup_table(&p->Table, s); } -static int +static int gx_serialize_CIEDEFG(const gs_color_space * pcs, stream * s) { const gs_cie_defg * p = pcs->params.defg; @@ -513,16 +513,16 @@ gx_serialize_CIEDEFG(const gs_color_space * pcs, stream * s) int code = gx_serialize_cie_common_elements(pcs, s); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&p->RangeDEFG, sizeof(p->RangeDEFG), &n); if (code < 0) - return code; + return code; for (k = 0; k < 3 && code >= 0; k++) - code = gx_serialize_cie_cache(&p->caches_defg.DecodeDEFG[k].floats, s); + code = gx_serialize_cie_cache(&p->caches_defg.DecodeDEFG[k].floats, s); if (code < 0) - return code; + return code; code = sputs(s, (const byte *)&p->RangeHIJK, sizeof(p->RangeHIJK), &n); if (code < 0) - return code; + return code; return gx_serialize_lookup_table(&p->Table, s); } |