summaryrefslogtreecommitdiff
path: root/gs
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2011-07-08 12:52:25 -0700
committerChris Liddell <chris.liddell@artifex.com>2012-03-15 11:52:07 +0000
commit8c0c7eaacf152b9292855e3748d454da05544de5 (patch)
treee3750a036b6e84d2a67e171d116dfd956eaf6773 /gs
parent355fa13a743c739dbce9b17f06d768e954539480 (diff)
Rename variables and objects to be denoted as source graphic tags
With recent commit of changes to object tags as being a graphic type tag it made sense to rename the source color object types similarly. CLUSTER_UNTESTED
Diffstat (limited to 'gs')
-rw-r--r--gs/base/gscms.h6
-rw-r--r--gs/base/gsicc_manage.c129
-rw-r--r--gs/base/gsicc_manage.h12
-rw-r--r--gs/psi/zusparam.c16
4 files changed, 82 insertions, 81 deletions
diff --git a/gs/base/gscms.h b/gs/base/gscms.h
index b6eba5b44..7d14f7d27 100644
--- a/gs/base/gscms.h
+++ b/gs/base/gscms.h
@@ -111,7 +111,7 @@ typedef enum {
} gsicc_profile_srctypes_t;
/* Source profiles for different objects. only CMYK and RGB */
-typedef struct cmm_srcobj_profile_s {
+typedef struct cmm_srcgtag_profile_s {
cmm_profile_t *rgb_profiles[NUM_SOURCE_PROFILES];
gsicc_rendering_intents_t rgb_intent[NUM_SOURCE_PROFILES];
cmm_profile_t *cmyk_profiles[NUM_SOURCE_PROFILES];
@@ -121,7 +121,7 @@ typedef struct cmm_srcobj_profile_s {
int name_length; /* Length of file name */
char *name; /* Name of file name where this is found */
rc_header rc;
-} cmm_srcobj_profile_t;
+} cmm_srcgtag_profile_t;
/* Destination profiles for different objects */
typedef struct cmm_dev_profile_s {
@@ -383,7 +383,7 @@ typedef struct gsicc_manager_s {
gsicc_smask_t *smask_profiles; /* Profiles used when we are in a softmask group */
char *profiledir; /* Directory used in searching for ICC profiles */
bool override_internal; /* Set via the user params */
- cmm_srcobj_profile_t *srcobj_profile;
+ cmm_srcgtag_profile_t *srcgtag_profile;
uint namelen;
gs_memory_t *memory;
rc_header rc;
diff --git a/gs/base/gsicc_manage.c b/gs/base/gsicc_manage.c
index 9f42133ba..7a2994c00 100644
--- a/gs/base/gsicc_manage.c
+++ b/gs/base/gsicc_manage.c
@@ -71,7 +71,7 @@ static int64_t gsicc_search_icc_table(clist_icctable_t *icc_table,
int64_t icc_hashcode, int *size);
static int gsicc_load_namedcolor_buffer(cmm_profile_t *profile, stream *s,
gs_memory_t *memory);
-static cmm_srcobj_profile_t* gsicc_new_srcobj_profile(gs_memory_t *memory);
+static cmm_srcgtag_profile_t* gsicc_new_srcgtag_profile(gs_memory_t *memory);
/* profile data structure */
/* profile_handle should NOT be garbage collected since it is allocated by the external CMS */
@@ -475,9 +475,9 @@ gsicc_get_default_type(cmm_profile_t *profile_data)
}
}
-/* This inititializes the srcobj structure in the ICC manager */
+/* This inititializes the srcgtag structure in the ICC manager */
int
-gsicc_set_srcobj_struct(gsicc_manager_t *icc_manager, const char* pname,
+gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname,
int namelen)
{
gs_memory_t *mem;
@@ -489,16 +489,16 @@ gsicc_set_srcobj_struct(gsicc_manager_t *icc_manager, const char* pname,
char str_format_key[6], str_format_file[6];
int count;
int k;
- static const char *const srcobj_keys[] = {GSICC_SRCOBJ_KEYS};
+ static const char *const srcgtag_keys[] = {GSICC_SRCGTAG_KEYS};
cmm_profile_t *icc_profile;
int ri;
- cmm_srcobj_profile_t *srcobj;
+ cmm_srcgtag_profile_t *srcgtag;
bool start = true;
/* If we don't have an icc manager or if this thing is already set
then ignore the call. For now, I am going going to allow it to
be set one time. */
- if (icc_manager == NULL || icc_manager->srcobj_profile != NULL) {
+ if (icc_manager == NULL || icc_manager->srcgtag_profile != NULL) {
return 0;
} else {
mem = icc_manager->memory;
@@ -510,12 +510,13 @@ gsicc_set_srcobj_struct(gsicc_manager_t *icc_manager, const char* pname,
code = sfseek(str,0,SEEK_END);
info_size = sftell(str);
code = srewind(str);
- if (info_size > (GSICC_NUM_SRCOBJ_KEYS + 1) * FILENAME_MAX) {
+ if (info_size > (GSICC_NUM_SRCGTAG_KEYS + 1) * FILENAME_MAX) {
return gs_rethrow1(-1, "setting of %s src obj color info failed",
pname);
}
/* Allocate the buffer, stuff with the data */
- buffer_ptr = (char*) gs_alloc_bytes(mem, info_size+1, "gsicc_set_srcobj_struct");
+ buffer_ptr = (char*) gs_alloc_bytes(mem, info_size+1,
+ "gsicc_set_srcgtag_struct");
if (buffer_ptr == NULL) {
return gs_rethrow1(-1, "setting of %s src obj color info failed",
pname);
@@ -524,15 +525,15 @@ gsicc_set_srcobj_struct(gsicc_manager_t *icc_manager, const char* pname,
code = sfclose(str);
buffer_ptr[info_size] = 0;
if (num_bytes != info_size) {
- gs_free_object(mem, buffer_ptr, "gsicc_set_srcobj_struct");
+ gs_free_object(mem, buffer_ptr, "gsicc_set_srcgtag_struct");
return gs_rethrow1(-1, "setting of %s src obj color info failed",
pname);
}
/* Create the structure in which we will store this data */
- srcobj = gsicc_new_srcobj_profile(mem);
+ srcgtag = gsicc_new_srcgtag_profile(mem);
/* Now parse through the data opening the profiles that are needed */
/* First create the format that we should read for the key */
- sprintf(str_format_key, "%%%ds", GSICC_SRC_OBJ_MAX_KEY);
+ sprintf(str_format_key, "%%%ds", GSICC_SRCGTAG_MAX_KEY);
sprintf(str_format_file, "%%%ds", FILENAME_MAX);
curr_ptr = buffer_ptr;
@@ -545,8 +546,8 @@ gsicc_set_srcobj_struct(gsicc_manager_t *icc_manager, const char* pname,
}
if (curr_ptr == NULL) break;
/* Now go ahead and see if we have a match */
- for (k = 0; k < GSICC_NUM_SRCOBJ_KEYS; k++) {
- if (strncmp(curr_ptr, srcobj_keys[k], strlen(srcobj_keys[k])) == 0 ) {
+ for (k = 0; k < GSICC_NUM_SRCGTAG_KEYS; k++) {
+ if (strncmp(curr_ptr, srcgtag_keys[k], strlen(srcgtag_keys[k])) == 0 ) {
/* Try to open the file and set the profile */
curr_ptr = strtok(NULL, "\t,\32\n\r");
str = gsicc_open_search(curr_ptr, strlen(curr_ptr), mem,
@@ -560,84 +561,84 @@ gsicc_set_srcobj_struct(gsicc_manager_t *icc_manager, const char* pname,
break;
} else {
/* Failed to open profile file. End this now. */
- gs_free_object(mem, buffer_ptr, "gsicc_set_srcobj_struct");
- rc_decrement(srcobj, "gsicc_set_srcobj_struct");
+ gs_free_object(mem, buffer_ptr, "gsicc_set_srcgtag_struct");
+ rc_decrement(srcgtag, "gsicc_set_srcgtag_struct");
return gs_rethrow1(-1,
"setting of %s src obj color info failed", pname);
}
}
}
- /* Get the intent now and set the profile. If GSICC_SRCOBJ_KEYS
+ /* Get the intent now and set the profile. If GSICC_SRCGTAG_KEYS
order changes this switch needs to change also */
switch (k) {
case COLOR_TUNE:
/* Color tune profile. No intent */
- srcobj->color_warp_profile = icc_profile;
+ srcgtag->color_warp_profile = icc_profile;
break;
case GRAPHIC_CMYK:
- srcobj->cmyk_profiles[gsSRC_GRAPPRO] = icc_profile;
+ srcgtag->cmyk_profiles[gsSRC_GRAPPRO] = icc_profile;
/* Get the intent */
curr_ptr = strtok(NULL, "\t,\32\n\r");
count = sscanf(curr_ptr, "%d", &ri);
- srcobj->cmyk_intent[gsSRC_GRAPPRO] = ri;
+ srcgtag->cmyk_intent[gsSRC_GRAPPRO] = ri;
break;
case IMAGE_CMYK:
- srcobj->cmyk_profiles[gsSRC_IMAGPRO] = icc_profile;
+ srcgtag->cmyk_profiles[gsSRC_IMAGPRO] = icc_profile;
/* Get the intent */
curr_ptr = strtok(NULL, "\t,\32\n\r");
count = sscanf(curr_ptr, "%d", &ri);
- srcobj->cmyk_intent[gsSRC_IMAGPRO] = ri;
+ srcgtag->cmyk_intent[gsSRC_IMAGPRO] = ri;
break;
case TEXT_CMYK:
- srcobj->cmyk_profiles[gsSRC_TEXTPRO] = icc_profile;
+ srcgtag->cmyk_profiles[gsSRC_TEXTPRO] = icc_profile;
/* Get the intent */
curr_ptr = strtok(NULL, "\t,\32\n\r");
count = sscanf(curr_ptr, "%d", &ri);
- srcobj->cmyk_intent[gsSRC_TEXTPRO] = ri;
+ srcgtag->cmyk_intent[gsSRC_TEXTPRO] = ri;
break;
case GRAPHIC_RGB:
- srcobj->rgb_profiles[gsSRC_GRAPPRO] = icc_profile;
+ srcgtag->rgb_profiles[gsSRC_GRAPPRO] = icc_profile;
/* Get the intent */
curr_ptr = strtok(NULL, "\t,\32\n\r");
count = sscanf(curr_ptr, "%d", &ri);
- srcobj->cmyk_intent[gsSRC_GRAPPRO] = ri;
+ srcgtag->cmyk_intent[gsSRC_GRAPPRO] = ri;
break;
case IMAGE_RGB:
- srcobj->rgb_profiles[gsSRC_IMAGPRO] = icc_profile;
+ srcgtag->rgb_profiles[gsSRC_IMAGPRO] = icc_profile;
/* Get the intent */
curr_ptr = strtok(NULL, "\t,\32\n\r");
count = sscanf(curr_ptr, "%d", &ri);
- srcobj->cmyk_intent[gsSRC_IMAGPRO] = ri;
+ srcgtag->cmyk_intent[gsSRC_IMAGPRO] = ri;
break;
case TEXT_RGB:
- srcobj->rgb_profiles[gsSRC_TEXTPRO] = icc_profile;
+ srcgtag->rgb_profiles[gsSRC_TEXTPRO] = icc_profile;
/* Get the intent */
curr_ptr = strtok(NULL, "\t,\32\n\r");
count = sscanf(curr_ptr, "%d", &ri);
- srcobj->cmyk_intent[gsSRC_TEXTPRO] = ri;
+ srcgtag->cmyk_intent[gsSRC_TEXTPRO] = ri;
break;
- case GSICC_NUM_SRCOBJ_KEYS:
+ case GSICC_NUM_SRCGTAG_KEYS:
/* Failed to match the key */
- gs_free_object(mem, buffer_ptr, "gsicc_set_srcobj_struct");
- rc_decrement(srcobj, "gsicc_set_srcobj_struct");
+ gs_free_object(mem, buffer_ptr, "gsicc_set_srcgtag_struct");
+ rc_decrement(srcgtag, "gsicc_set_srcgtag_struct");
return gs_rethrow1(-1, "failed to find key in %s", pname);
break;
default:
/* Some issue */
- gs_free_object(mem, buffer_ptr, "gsicc_set_srcobj_struct");
- rc_decrement(srcobj, "gsicc_set_srcobj_struct");
- return gs_rethrow1(-1, "Error in srcobj data %s", pname);
+ gs_free_object(mem, buffer_ptr, "gsicc_set_srcgtag_struct");
+ rc_decrement(srcgtag, "gsicc_set_srcgtag_struct");
+ return gs_rethrow1(-1, "Error in srcgtag data %s", pname);
break;
}
}
} else {
return gs_rethrow1(-1, "setting of %s src obj color info failed", pname);
}
- gs_free_object(mem, buffer_ptr, "gsicc_set_srcobj_struct");
- srcobj->name_length = strlen(pname);
- srcobj->name = (char*) gs_alloc_bytes(mem, srcobj->name_length,
- "gsicc_set_srcobj_struct");
- strncpy(srcobj->name, pname, srcobj->name_length);
+ gs_free_object(mem, buffer_ptr, "gsicc_set_srcgtag_struct");
+ srcgtag->name_length = strlen(pname);
+ srcgtag->name = (char*) gs_alloc_bytes(mem, srcgtag->name_length,
+ "gsicc_set_srcgtag_struct");
+ strncpy(srcgtag->name, pname, srcgtag->name_length);
return 0;
}
@@ -905,43 +906,43 @@ gsicc_open_search(const char* pname, int namelen, gs_memory_t *mem_gc,
/* Free source object icc array structure. */
static void
-rc_free_srcobj_profile(gs_memory_t * mem, void *ptr_in, client_name_t cname)
+rc_free_srcgtag_profile(gs_memory_t * mem, void *ptr_in, client_name_t cname)
{
- cmm_srcobj_profile_t *srcobj_profile = (cmm_srcobj_profile_t *)ptr_in;
+ cmm_srcgtag_profile_t *srcgtag_profile = (cmm_srcgtag_profile_t *)ptr_in;
int k;
- gs_memory_t *mem_nongc = srcobj_profile->memory;
+ gs_memory_t *mem_nongc = srcgtag_profile->memory;
- if (srcobj_profile->rc.ref_count <= 1 ) {
+ if (srcgtag_profile->rc.ref_count <= 1 ) {
/* Decrement any profiles. */
for (k = 0; k < NUM_SOURCE_PROFILES; k++) {
- if (srcobj_profile->rgb_profiles[k] != NULL) {
- rc_decrement(srcobj_profile->rgb_profiles[k],
- "rc_free_srcobj_profile");
+ if (srcgtag_profile->rgb_profiles[k] != NULL) {
+ rc_decrement(srcgtag_profile->rgb_profiles[k],
+ "rc_free_srcgtag_profile");
}
- if (srcobj_profile->cmyk_profiles[k] != NULL) {
- rc_decrement(srcobj_profile->cmyk_profiles[k],
- "rc_free_srcobj_profile");
+ if (srcgtag_profile->cmyk_profiles[k] != NULL) {
+ rc_decrement(srcgtag_profile->cmyk_profiles[k],
+ "rc_free_srcgtag_profile");
}
- if (srcobj_profile->color_warp_profile != NULL) {
- rc_decrement(srcobj_profile->color_warp_profile,
- "rc_free_srcobj_profile");
+ if (srcgtag_profile->color_warp_profile != NULL) {
+ rc_decrement(srcgtag_profile->color_warp_profile,
+ "rc_free_srcgtag_profile");
}
}
- gs_free_object(mem_nongc, srcobj_profile->name, "rc_free_srcobj_profile");
- gs_free_object(mem_nongc, srcobj_profile, "rc_free_srcobj_profile");
+ gs_free_object(mem_nongc, srcgtag_profile->name, "rc_free_srcgtag_profile");
+ gs_free_object(mem_nongc, srcgtag_profile, "rc_free_srcgtag_profile");
}
}
/* Allocate source object icc structure. */
-static cmm_srcobj_profile_t*
-gsicc_new_srcobj_profile(gs_memory_t *memory)
+static cmm_srcgtag_profile_t*
+gsicc_new_srcgtag_profile(gs_memory_t *memory)
{
- cmm_srcobj_profile_t *result;
+ cmm_srcgtag_profile_t *result;
int k;
- result = (cmm_srcobj_profile_t *) gs_alloc_bytes(memory->non_gc_memory,
- sizeof(cmm_srcobj_profile_t),
- "gsicc_new_srcobj_profile");
+ result = (cmm_srcgtag_profile_t *) gs_alloc_bytes(memory->non_gc_memory,
+ sizeof(cmm_srcgtag_profile_t),
+ "gsicc_new_srcgtag_profile");
result->memory = memory->non_gc_memory;
for (k = 0; k < NUM_SOURCE_PROFILES; k++) {
@@ -953,7 +954,7 @@ gsicc_new_srcobj_profile(gs_memory_t *memory)
}
result->name = NULL;
result->name_length = 0;
- rc_init_free(result, memory->non_gc_memory, 1, rc_free_srcobj_profile);
+ rc_init_free(result, memory->non_gc_memory, 1, rc_free_srcgtag_profile);
return(result);
}
@@ -1359,7 +1360,7 @@ gsicc_manager_new(gs_memory_t *memory)
result->smask_profiles = NULL;
result->memory = memory->stable_memory;
result->profiledir = NULL;
- result->srcobj_profile = NULL;
+ result->srcgtag_profile = NULL;
result->override_internal = false;
result->namelen = 0;
return(result);
@@ -1381,7 +1382,7 @@ rc_gsicc_manager_free(gs_memory_t * mem, void *ptr_in, client_name_t cname)
rc_decrement(icc_manager->output_link, "rc_gsicc_manager_free");
rc_decrement(icc_manager->proof_profile, "rc_gsicc_manager_free");
rc_decrement(icc_manager->lab_profile, "rc_gsicc_manager_free");
- rc_decrement(icc_manager->srcobj_profile, "rc_gsicc_manager_free");
+ rc_decrement(icc_manager->srcgtag_profile, "rc_gsicc_manager_free");
/* Loop through the DeviceN profiles */
if ( icc_manager->device_n != NULL) {
diff --git a/gs/base/gsicc_manage.h b/gs/base/gsicc_manage.h
index fb43e335c..81a71dcff 100644
--- a/gs/base/gsicc_manage.h
+++ b/gs/base/gsicc_manage.h
@@ -39,7 +39,7 @@
#define GSICC_NUMBER_STANDARD_PROFILES 2
#define GSICC_STANDARD_INTENT_KEYS\
"per", "col" , "sat", "abs"
-/* This enumeration has to be in sync with GSICC_SRCOBJ_KEYS */
+/* This enumeration has to be in sync with GSICC_SRCGTAG_KEYS */
typedef enum {
COLOR_TUNE,
GRAPHIC_CMYK,
@@ -48,13 +48,13 @@ typedef enum {
GRAPHIC_RGB,
IMAGE_RGB,
TEXT_RGB
-} gsicc_srcobjkey_t;
+} gsicc_srcgtagkey_t;
-#define GSICC_SRCOBJ_KEYS\
+#define GSICC_SRCGTAG_KEYS\
"ColorTune", "Graphic_CMYK", "Image_CMYK", "Text_CMYK",\
"Graphic_RGB", "Image_RGB", "Text_RGB"
-#define GSICC_NUM_SRCOBJ_KEYS 7
-#define GSICC_SRC_OBJ_MAX_KEY 12
+#define GSICC_NUM_SRCGTAG_KEYS 7
+#define GSICC_SRCGTAG_MAX_KEY 12
#include "gsicc_cms.h"
@@ -76,7 +76,7 @@ int gsicc_init_device_profile_struct(gx_device * dev, char *profile_name,
cmm_dev_profile_name_array_t* gsicc_new_dev_icc_names(gs_memory_t *memory);
int gsicc_set_profile(gsicc_manager_t *icc_manager, const char *pname,
int namelen, gsicc_profile_t defaulttype);
-int gsicc_set_srcobj_struct(gsicc_manager_t *icc_manager, const char* pname,
+int gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname,
int namelen);
cmm_profile_t* gsicc_get_profile_handle_file(const char* pname, int namelen,
gs_memory_t *mem);
diff --git a/gs/psi/zusparam.c b/gs/psi/zusparam.c
index 17242b915..af8370384 100644
--- a/gs/psi/zusparam.c
+++ b/gs/psi/zusparam.c
@@ -642,23 +642,23 @@ set_icc_directory(i_ctx_t *i_ctx_p, gs_param_string * pval)
}
static void
-current_srcobj_icc(i_ctx_t *i_ctx_p, gs_param_string * pval)
+current_srcgtag_icc(i_ctx_t *i_ctx_p, gs_param_string * pval)
{
const gs_imager_state * pis = (gs_imager_state *) igs;
- if (pis->icc_manager->srcobj_profile == NULL) {
+ if (pis->icc_manager->srcgtag_profile == NULL) {
pval->data = NULL;
pval->size = 0;
pval->persistent = true;
} else {
- pval->data = pis->icc_manager->srcobj_profile->name;
+ pval->data = pis->icc_manager->srcgtag_profile->name;
pval->size = strlen((const char *)pval->data);
pval->persistent = true;
}
}
static int
-set_srcobj_icc(i_ctx_t *i_ctx_p, gs_param_string * pval)
+set_srcgtag_icc(i_ctx_t *i_ctx_p, gs_param_string * pval)
{
int code;
char *pname;
@@ -667,12 +667,12 @@ set_srcobj_icc(i_ctx_t *i_ctx_p, gs_param_string * pval)
gs_memory_t *mem = pis->memory;
if (pval->size == 0) return 0;
- pname = (char *)gs_alloc_bytes(mem, namelen, "set_srcobj_icc");
+ pname = (char *)gs_alloc_bytes(mem, namelen, "set_srcgtag_icc");
memcpy(pname,pval->data,namelen-1);
pname[namelen-1] = 0;
- code = gsicc_set_srcobj_struct(pis->icc_manager, (const char*) pname,
+ code = gsicc_set_srcgtag_struct(pis->icc_manager, (const char*) pname,
namelen);
- gs_free_object(mem, pname, "set_srcobj_icc");
+ gs_free_object(mem, pname, "set_srcgtag_icc");
if (code < 0)
return gs_rethrow(code, "cannot find srcobj file");
return(code);
@@ -910,7 +910,7 @@ static const string_param_def_t user_string_params[] =
{"ICCProfilesDir", current_icc_directory, set_icc_directory},
{"LabProfile", current_lab_icc, set_lab_icc},
{"DeviceNProfile", current_devicen_icc, set_devicen_profile_icc},
- {"SourceObjectICC", current_srcobj_icc, set_srcobj_icc}
+ {"SourceObjectICC", current_srcgtag_icc, set_srcgtag_icc}
};
/* Boolean values */