Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

src/main/print-color.c File Reference

#include <gimp-print/gimp-print.h>
#include "gimp-print-internal.h"
#include <gimp-print/gimp-print-intl-internal.h>
#include <gimp-print/curve-cache.h>
#include <math.h>
#include <string.h>
#include "color-conversion.h"

Go to the source code of this file.

Data Structures

struct  curve_param_t
struct  float_param_t

Defines

#define RAW_GAMMA_CHANNEL(channel)
#define RAW_CURVE_CHANNEL(channel)
#define stp_module_version   color_traditional_LTX_stp_module_version
#define stp_module_data   color_traditional_LTX_stp_module_data

Functions

const color_description_tget_color_description (const char *name)
const channel_depth_tget_channel_depth (const char *name)
const color_correction_tget_color_correction (const char *name)
const color_correction_tget_color_correction_by_tag (color_correction_enum_t correction)
void initialize_channels (stp_vars_t *v, stp_image_t *image)
int stpi_color_traditional_get_row (stp_vars_t *v, stp_image_t *image, int row, unsigned *zero_mask)
void free_channels (lut_t *lut)
lut_tallocate_lut (void)
void * copy_lut (void *vlut)
void free_lut (void *vlut)
stp_curve_tcompute_gcr_curve (const stp_vars_t *vars)
void initialize_gcr_curve (const stp_vars_t *vars)
int channel_is_synthesized (lut_t *lut, int channel)
void compute_a_curve_full (lut_t *lut, int channel)
void compute_a_curve_fast (lut_t *lut, int channel)
void compute_a_curve (lut_t *lut, int channel)
void invert_curve (stp_curve_t *curve, int invert_output)
void compute_one_lut (lut_t *lut, int i)
void setup_channel (stp_vars_t *v, int i, const channel_param_t *p)
void stpi_compute_lut (stp_vars_t *v)
int stpi_color_traditional_init (stp_vars_t *v, stp_image_t *image, size_t steps)
void initialize_standard_curves (void)
stp_parameter_list_t stpi_color_traditional_list_parameters (const stp_vars_t *v)
void stpi_color_traditional_describe_parameter (const stp_vars_t *v, const char *name, stp_parameter_t *description)
int color_traditional_module_init (void)
int color_traditional_module_exit (void)

Variables

const color_correction_t color_corrections []
const int color_correction_count
const channel_param_t channel_params []
const int channel_param_count
const channel_param_t raw_channel_params []
const int raw_channel_param_count
const color_description_t color_descriptions []
const int color_description_count
const channel_depth_t channel_depths []
const int channel_depth_count
const float_param_t float_parameters []
const int float_parameter_count
int standard_curves_initialized = 0
stp_curve_thue_map_bounds = NULL
stp_curve_tlum_map_bounds = NULL
stp_curve_tsat_map_bounds = NULL
stp_curve_tcolor_curve_bounds = NULL
stp_curve_tgcr_curve_bounds = NULL
curve_param_t curve_parameters []
const int curve_parameter_count
const stp_colorfuncs_t stpi_color_traditional_colorfuncs
const stp_color_t stpi_color_traditional_module_data
stp_module_version_t stp_module_version = {0, 0}
stp_module_t stp_module_data


Define Documentation

#define RAW_CURVE_CHANNEL channel   
 

Value:

{                                                                       \
    {                                                                   \
      "CurveCh" #channel, N_("Channel " #channel " Curve"),             \
      N_("Output Curves"), N_("Curve for raw channel " #channel),       \
      STP_PARAMETER_TYPE_CURVE, STP_PARAMETER_CLASS_OUTPUT,             \
      STP_PARAMETER_LEVEL_INTERNAL, 0, 1, channel, 1, 0                 \
    }, &color_curve_bounds, CMASK_RAW, 0, 0                             \
  }

Definition at line 404 of file print-color.c.

#define RAW_GAMMA_CHANNEL channel   
 

Value:

{                                                                        \
    {                                                                    \
      "GammaCh" #channel, N_("Channel " #channel " Gamma"), N_("Gamma"), \
      N_("Gamma for raw channel " #channel),                             \
      STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_CLASS_OUTPUT,             \
      STP_PARAMETER_LEVEL_INTERNAL, 0, 1, channel, 1, 0                  \
    }, 0.1, 4.0, 1.0, CMASK_RAW, 0                                       \
  }

Definition at line 162 of file print-color.c.

#define stp_module_data   color_traditional_LTX_stp_module_data
 

Definition at line 1520 of file print-color.c.

#define stp_module_version   color_traditional_LTX_stp_module_version
 

Definition at line 1519 of file print-color.c.


Function Documentation

lut_t* allocate_lut void    [static]
 

Definition at line 643 of file print-color.c.

References lut_t::app_gamma, lut_t::brightness, lut_t::contrast, lut_t::gamma_values, lut_t::print_gamma, STP_CHANNEL_LIMIT, and stp_zalloc().

int channel_is_synthesized lut_t   lut,
int    channel
[static]
 

Definition at line 848 of file print-color.c.

References color_description_t::channels, color_description_t::color_id, lut_t::input_color_description, and lut_t::output_color_description.

Referenced by compute_a_curve(), and compute_one_lut().

int color_traditional_module_exit void    [static]
 

Definition at line 1512 of file print-color.c.

References stp_color_unregister().

int color_traditional_module_init void    [static]
 

Definition at line 1505 of file print-color.c.

References stp_color_register().

void compute_a_curve lut_t   lut,
int    channel
[static]
 

Definition at line 1002 of file print-color.c.

References channel_is_synthesized(), compute_a_curve_fast(), and compute_a_curve_full().

Referenced by compute_one_lut().

void compute_a_curve_fast lut_t   lut,
int    channel
[static]
 

Definition at line 975 of file print-color.c.

References lut_t::channel_curves, lut_t::gamma_values, lut_t::steps, stp_curve_cache_get_curve(), stp_curve_resample(), stp_curve_set_data(), stp_free(), and stp_malloc().

Referenced by compute_a_curve().

void compute_a_curve_full lut_t   lut,
int    channel
[static]
 

Definition at line 866 of file print-color.c.

References lut_t::brightness, lut_t::channel_curves, color_description_t::color_model, lut_t::contrast, lut_t::gamma_values, lut_t::input_color_description, lut_t::linear_contrast_adjustment, lut_t::output_color_description, lut_t::print_gamma, lut_t::screen_gamma, lut_t::steps, stp_curve_cache_get_curve(), stp_curve_resample(), stp_curve_set_data(), stp_free(), and stp_malloc().

Referenced by compute_a_curve().

stp_curve_t* compute_gcr_curve const stp_vars_t   vars [static]
 

Definition at line 723 of file print-color.c.

References lut_t::steps, stp_abort(), stp_check_float_parameter(), stp_curve_create(), stp_curve_set_bounds(), stp_curve_set_data(), STP_CURVE_WRAP_NONE, stp_eprintf(), stp_free(), stp_get_component_data(), stp_get_float_parameter(), stp_malloc(), and STP_PARAMETER_DEFAULTED.

Referenced by generic_rgb_to_kcmy(), and initialize_gcr_curve().

void compute_one_lut lut_t   lut,
int    i
[static]
 

Definition at line 1042 of file print-color.c.

References lut_t::channel_curves, channel_is_synthesized(), compute_a_curve(), invert_curve(), lut_t::invert_output, lut_t::steps, STP_CURVE_BOUNDS_RESCALE, stp_curve_cache_get_curve(), stp_curve_cache_set_curve(), STP_CURVE_COMPOSE_MULTIPLY, stp_curve_create_copy(), stp_curve_resample(), and stp_curve_rescale().

Referenced by initialize_color_curves(), initialize_composite_curve(), setup_channel(), and stpi_compute_lut().

void* copy_lut void *    vlut [static]
 

Definition at line 659 of file print-color.c.

References allocate_lut(), lut_t::app_gamma, lut_t::brightness, lut_t::channel_curves, lut_t::channel_depth, lut_t::color_correction, lut_t::contrast, free_channels(), lut_t::gamma_values, lut_t::gcr_curve, lut_t::hue_map, lut_t::image_width, lut_t::in_channels, lut_t::in_data, lut_t::input_color_description, lut_t::invert_output, lut_t::linear_contrast_adjustment, lut_t::lum_map, lut_t::out_channels, lut_t::output_color_description, lut_t::print_gamma, lut_t::sat_map, lut_t::screen_gamma, lut_t::steps, STP_CHANNEL_LIMIT, stp_curve_cache_copy(), and stp_malloc().

Referenced by stpi_color_traditional_init().

void free_channels lut_t   lut [static]
 

Definition at line 635 of file print-color.c.

References lut_t::channel_curves, STP_CHANNEL_LIMIT, and stp_curve_free_curve_cache().

Referenced by copy_lut(), and free_lut().

void free_lut void *    vlut [static]
 

Definition at line 706 of file print-color.c.

References lut_t::cmy_tmp, lut_t::cmyk_tmp, free_channels(), lut_t::gcr_curve, lut_t::gray_tmp, lut_t::hue_map, lut_t::in_data, lut_t::lum_map, lut_t::sat_map, stp_curve_free_curve_cache(), stp_free(), and STP_SAFE_FREE.

Referenced by stpi_color_traditional_init().

const channel_depth_t* get_channel_depth const char *    name [static]
 

Definition at line 564 of file print-color.c.

References channel_depth_count.

Referenced by stpi_color_traditional_init().

const color_correction_t* get_color_correction const char *    name [static]
 

Definition at line 577 of file print-color.c.

References color_correction_count.

Referenced by stpi_color_traditional_init().

const color_correction_t* get_color_correction_by_tag color_correction_enum_t    correction [static]
 

Definition at line 590 of file print-color.c.

References color_correction_count, and color_correction_t::correction.

const color_description_t* get_color_description const char *    name [static]
 

Definition at line 551 of file print-color.c.

References color_description_count.

Referenced by stpi_color_traditional_describe_parameter(), and stpi_color_traditional_init().

void initialize_channels stp_vars_t   v,
stp_image_t   image
[static]
 

Definition at line 603 of file print-color.c.

References lut_t::channels_are_initialized, lut_t::out_channels, stp_channel_initialize(), stp_channel_set_ink_limit(), stp_check_float_parameter(), stp_get_component_data(), stp_get_float_parameter(), and STP_PARAMETER_ACTIVE.

Referenced by stpi_color_traditional_get_row().

void initialize_gcr_curve const stp_vars_t   vars [static]
 

Definition at line 787 of file print-color.c.

References lut_t::gcr_curve, lut_t::steps, stp_check_curve_parameter(), stp_curve_cache_get_curve(), stp_curve_cache_set_curve(), stp_curve_count_points(), stp_curve_create_copy(), stp_curve_get_point(), stp_curve_resample(), stp_curve_set_bounds(), stp_curve_set_point(), stp_get_component_data(), stp_get_curve_parameter(), and STP_PARAMETER_DEFAULTED.

Referenced by generic_cmy_to_kcmy(), and stpi_compute_lut().

void initialize_standard_curves void    [static]
 

Definition at line 1238 of file print-color.c.

References curve_parameter_count, stp_parameter_t::deflt, curve_param_t::defval, curve_param_t::param, and standard_curves_initialized.

void invert_curve stp_curve_t   curve,
int    invert_output
[static]
 

Definition at line 1011 of file print-color.c.

References STP_CURVE_BOUNDS_RESCALE, STP_CURVE_COMPOSE_ADD, STP_CURVE_COMPOSE_MULTIPLY, stp_curve_get_bounds(), stp_curve_get_data(), stp_curve_get_gamma(), stp_curve_rescale(), stp_curve_set_data(), stp_curve_set_gamma(), stp_free(), and stp_malloc().

Referenced by compute_one_lut().

void setup_channel stp_vars_t   v,
int    i,
const channel_param_t   p
[static]
 

Definition at line 1066 of file print-color.c.

References lut_t::channel_curves, color_description_t::color_model, compute_one_lut(), channel_param_t::curve_name, channel_param_t::gamma_name, lut_t::gamma_values, lut_t::output_color_description, channel_param_t::rgb_curve_name, channel_param_t::rgb_gamma_name, stp_check_float_parameter(), STP_DBG_LUT, stp_dprintf(), stp_get_component_data(), stp_get_curve_parameter(), stp_get_curve_parameter_active(), stp_get_float_parameter(), stp_get_float_parameter_active(), and STP_PARAMETER_DEFAULTED.

Referenced by stpi_compute_lut().

void stpi_color_traditional_describe_parameter const stp_vars_t   v,
const char *    name,
stp_parameter_t   description
[static]
 

Definition at line 1308 of file print-color.c.

References _, stp_parameter_t::bounds, channel_depth_count, curve_param_t::channel_mask, float_param_t::channel_mask, color_description_t::channels, color_correction_count, color_description_count, color_description_t::color_id, curve_param_t::color_only, float_param_t::color_only, color_correction_t::correct_hsl, curve_parameter_count, stp_parameter_t::deflt, curve_param_t::defval, float_param_t::defval, float_parameter_count, get_color_description(), curve_param_t::hsl_only, initialize_standard_curves(), color_description_t::input, stp_parameter_t::is_active, float_param_t::max, float_param_t::min, color_description_t::name, channel_depth_t::name, stp_param_string_t::name, color_correction_t::name, stp_parameter_t::name, color_description_t::output, stp_parameter_t::p_level, stp_parameter_t::p_type, curve_param_t::param, float_param_t::param, stp_check_string_parameter(), stp_curve_create_copy(), stp_describe_output(), stp_describe_parameter(), stp_fill_parameter_settings(), stp_get_string_parameter(), STP_PARAMETER_ACTIVE, stp_parameter_description_destroy(), STP_PARAMETER_LEVEL_BASIC, STP_PARAMETER_TYPE_BOOLEAN, STP_PARAMETER_TYPE_CURVE, STP_PARAMETER_TYPE_DOUBLE, STP_PARAMETER_TYPE_INT, STP_PARAMETER_TYPE_INVALID, STP_PARAMETER_TYPE_STRING_LIST, stp_string_list_create(), and stp_string_list_param().

int stpi_color_traditional_get_row stp_vars_t   v,
stp_image_t   image,
int    row,
unsigned *    zero_mask
[static]
 

Definition at line 613 of file print-color.c.

References lut_t::channels_are_initialized, color_description_t::conversion_function, lut_t::image_width, lut_t::in_channels, lut_t::in_data, initialize_channels(), lut_t::output_color_description, stp_channel_convert(), stp_channel_get_input(), stp_get_component_data(), stp_image_get_row(), and STP_IMAGE_STATUS_OK.

int stpi_color_traditional_init stp_vars_t   v,
stp_image_t   image,
size_t    steps
[static]
 

Definition at line 1164 of file print-color.c.

References allocate_lut(), channel_depth_t::bits, color_description_t::channel_count, lut_t::channel_depth, lut_t::color_correction, color_description_t::color_id, copy_lut(), color_correction_t::correction, color_description_t::default_correction, free_lut(), get_channel_depth(), get_color_correction(), get_color_description(), lut_t::image_width, lut_t::in_channels, lut_t::in_data, lut_t::input_color_description, lut_t::out_channels, lut_t::output_color_description, PARAMETER_OK, lut_t::steps, stp_allocate_component_data(), stp_get_int_parameter(), stp_get_string_parameter(), stp_image_width(), stp_malloc(), stp_verify_parameter(), and stpi_compute_lut().

stp_parameter_list_t stpi_color_traditional_list_parameters const stp_vars_t   v [static]
 

Definition at line 1295 of file print-color.c.

References curve_parameter_count, float_parameter_count, initialize_standard_curves(), stp_parameter_list_add_param(), and stp_parameter_list_create().

void stpi_compute_lut stp_vars_t   v [static]
 

Definition at line 1090 of file print-color.c.

References lut_t::app_gamma, lut_t::brightness, color_description_t::channel_count, channel_param_count, color_description_t::channels, lut_t::color_correction, color_description_t::color_id, color_description_t::color_model, lut_t::contrast, color_correction_t::correct_hsl, stp_cached_curve_t::curve, lut_t::hue_map, initialize_gcr_curve(), lut_t::input_color_description, lut_t::invert_output, lut_t::linear_contrast_adjustment, lut_t::lum_map, lut_t::out_channels, lut_t::output_color_description, lut_t::print_gamma, lut_t::sat_map, lut_t::screen_gamma, setup_channel(), STP_CHANNEL_LIMIT, stp_check_boolean_parameter(), stp_check_curve_parameter(), stp_check_float_parameter(), stp_curve_create_copy(), STP_DBG_LUT, stp_dprintf(), stp_get_boolean_parameter(), stp_get_component_data(), stp_get_curve_parameter(), stp_get_float_parameter(), STP_PARAMETER_ACTIVE, and STP_PARAMETER_DEFAULTED.

Referenced by stpi_color_traditional_init().


Variable Documentation

const int channel_depth_count [static]
 

Initial value:

sizeof(channel_depths) / sizeof(channel_depth_t)

Definition at line 148 of file print-color.c.

Referenced by get_channel_depth(), and stpi_color_traditional_describe_parameter().

const channel_depth_t channel_depths[] [static]
 

Initial value:

{
  { "8",  8  },
  { "16", 16 }
}

Definition at line 142 of file print-color.c.

const int channel_param_count [static]
 

Initial value:

sizeof(channel_params) / sizeof(channel_param_t)

Definition at line 75 of file print-color.c.

Referenced by stpi_compute_lut().

const channel_param_t channel_params[] [static]
 

Initial value:

{
  { CMASK_K, "BlackGamma",   "BlackCurve",   "WhiteGamma",   "WhiteCurve"   },
  { CMASK_C, "CyanGamma",    "CyanCurve",    "RedGamma",     "RedCurve"     },
  { CMASK_M, "MagentaGamma", "MagentaCurve", "GreenGamma",   "GreenCurve"   },
  { CMASK_Y, "YellowGamma",  "YellowCurve",  "BlueGamma",    "BlueCurve"    },
  { CMASK_W, "WhiteGamma",   "WhiteCurve",   "BlackGamma",   "BlackCurve"   },
  { CMASK_R, "RedGamma",     "RedCurve",     "CyanGamma",    "CyanCurve"    },
  { CMASK_G, "GreenGamma",   "GreenCurve",   "MagentaGamma", "MagentaCurve" },
  { CMASK_B, "BlueGamma",    "BlueCurve",    "YellowGamma",  "YellowCurve"  },
}

Definition at line 63 of file print-color.c.

const int color_correction_count [static]
 

Initial value:

sizeof(color_corrections) / sizeof(color_correction_t)

Definition at line 59 of file print-color.c.

Referenced by get_color_correction(), get_color_correction_by_tag(), and stpi_color_traditional_describe_parameter().

const color_correction_t color_corrections[] [static]
 

Initial value:

{
  { "None",        N_("Default"),       COLOR_CORRECTION_DEFAULT,     1 },
  { "Accurate",    N_("High Accuracy"), COLOR_CORRECTION_ACCURATE,    1 },
  { "Bright",      N_("Bright Colors"), COLOR_CORRECTION_BRIGHT,      1 },
  { "Uncorrected", N_("Uncorrected"),   COLOR_CORRECTION_UNCORRECTED, 0 },
  { "Desaturated", N_("Desaturated"),   COLOR_CORRECTION_DESATURATED, 0 },
  { "Threshold",   N_("Threshold"),     COLOR_CORRECTION_THRESHOLD,   0 },
  { "Density",     N_("Density"),       COLOR_CORRECTION_DENSITY,     0 },
  { "Raw",         N_("Raw"),           COLOR_CORRECTION_RAW,         0 },
}

Definition at line 47 of file print-color.c.

stp_curve_t* color_curve_bounds = NULL [static]
 

Definition at line 400 of file print-color.c.

const int color_description_count [static]
 

Initial value:

sizeof(color_descriptions) / sizeof(color_description_t)

Definition at line 138 of file print-color.c.

Referenced by get_color_description(), and stpi_color_traditional_describe_parameter().

const color_description_t color_descriptions[] [static]
 

Initial value:

{
  { "Grayscale",  1, 1, COLOR_ID_GRAY,   COLOR_BLACK,   CMASK_K,      1,
    COLOR_CORRECTION_UNCORRECTED, &stpi_color_convert_to_gray   },
  { "Whitescale", 1, 1, COLOR_ID_WHITE,  COLOR_WHITE,   CMASK_K,      1,
    COLOR_CORRECTION_UNCORRECTED, &stpi_color_convert_to_gray   },
  { "RGB",        1, 1, COLOR_ID_RGB,    COLOR_WHITE,   CMASK_CMY,    3,
    COLOR_CORRECTION_ACCURATE,    &stpi_color_convert_to_color  },
  { "CMY",        1, 1, COLOR_ID_CMY,    COLOR_BLACK,   CMASK_CMY,    3,
    COLOR_CORRECTION_ACCURATE,    &stpi_color_convert_to_color  },
  { "CMYK",       1, 0, COLOR_ID_CMYK,   COLOR_BLACK,   CMASK_CMYK,   4,
    COLOR_CORRECTION_ACCURATE,    &stpi_color_convert_to_kcmy   },
  { "KCMY",       1, 1, COLOR_ID_KCMY,   COLOR_BLACK,   CMASK_CMYK,   4,
    COLOR_CORRECTION_ACCURATE,    &stpi_color_convert_to_kcmy   },
  { "CMYKRB",     0, 1, COLOR_ID_CMYKRB, COLOR_BLACK,   CMASK_CMYKRB, 6,
    COLOR_CORRECTION_ACCURATE,    &stpi_color_convert_to_cmykrb },
  { "Raw",        1, 1, COLOR_ID_RAW,    COLOR_UNKNOWN, 0,           -1,
    COLOR_CORRECTION_RAW,         &stpi_color_convert_raw       },
}

Definition at line 118 of file print-color.c.

const int curve_parameter_count [static]
 

Initial value:

sizeof(curve_parameters) / sizeof(curve_param_t)

Definition at line 546 of file print-color.c.

Referenced by initialize_standard_curves(), stpi_color_traditional_describe_parameter(), and stpi_color_traditional_list_parameters().

curve_param_t curve_parameters[] [static]
 

Definition at line 414 of file print-color.c.

const int float_parameter_count [static]
 

Initial value:

sizeof(float_parameters) / sizeof(float_param_t)

Definition at line 383 of file print-color.c.

Referenced by stpi_color_traditional_describe_parameter(), and stpi_color_traditional_list_parameters().

const float_param_t float_parameters[] [static]
 

Definition at line 172 of file print-color.c.

stp_curve_t* gcr_curve_bounds = NULL [static]
 

Definition at line 401 of file print-color.c.

stp_curve_t* hue_map_bounds = NULL [static]
 

Definition at line 397 of file print-color.c.

stp_curve_t* lum_map_bounds = NULL [static]
 

Definition at line 398 of file print-color.c.

const int raw_channel_param_count [static]
 

Initial value:

sizeof(raw_channel_params) / sizeof(channel_param_t)

Definition at line 114 of file print-color.c.

const channel_param_t raw_channel_params[] [static]
 

Definition at line 78 of file print-color.c.

stp_curve_t* sat_map_bounds = NULL [static]
 

Definition at line 399 of file print-color.c.

int standard_curves_initialized = 0 [static]
 

Definition at line 395 of file print-color.c.

Referenced by initialize_standard_curves().

stp_module_t stp_module_data
 

Initial value:

  {
    "traditional",
    VERSION,
    "Traditional Gimp-Print color conversion",
    STP_MODULE_CLASS_COLOR,
    NULL,
    color_traditional_module_init,
    color_traditional_module_exit,
    (void *) &stpi_color_traditional_module_data
  }

Definition at line 1524 of file print-color.c.

stp_module_version_t stp_module_version = {0, 0}
 

Definition at line 1522 of file print-color.c.

const stp_colorfuncs_t stpi_color_traditional_colorfuncs [static]
 

Initial value:

{
  &stpi_color_traditional_init,
  &stpi_color_traditional_get_row,
  &stpi_color_traditional_list_parameters,
  &stpi_color_traditional_describe_parameter
}

Definition at line 1488 of file print-color.c.

const stp_color_t stpi_color_traditional_module_data [static]
 

Initial value:

  {
    "traditional",
    N_("Traditional Gimp-Print color conversion"),
    &stpi_color_traditional_colorfuncs
  }

Definition at line 1496 of file print-color.c.


Generated on Wed May 12 20:21:36 2004 for libgimpprint API Reference by doxygen1.2.17