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

src/main/color.h

Go to the documentation of this file.
00001 /*
00002  * "$Id: color.h,v 1.15 2004/03/28 21:17:37 rlk Exp $"
00003  *
00004  *   libgimpprint header.
00005  *
00006  *   Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
00007  *      Robert Krawitz (rlk@alum.mit.edu)
00008  *
00009  *   This program is free software; you can redistribute it and/or modify it
00010  *   under the terms of the GNU General Public License as published by the Free
00011  *   Software Foundation; either version 2 of the License, or (at your option)
00012  *   any later version.
00013  *
00014  *   This program is distributed in the hope that it will be useful, but
00015  *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00016  *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00017  *   for more details.
00018  *
00019  *   You should have received a copy of the GNU General Public License
00020  *   along with this program; if not, write to the Free Software
00021  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00022  *
00023  * Revision History:
00024  *
00025  *   See ChangeLog
00026  */
00027 
00028 /*
00029  * This file must include only standard C header files.  The core code must
00030  * compile on generic platforms that don't support glib, gimp, gtk, etc.
00031  */
00032 
00033 #ifndef GIMP_PRINT_INTERNAL_COLOR_H
00034 #define GIMP_PRINT_INTERNAL_COLOR_H
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 
00041 #include <gimp-print/color.h>
00042 
00043 #if 0
00044 typedef enum
00045 {
00046   STP_OUTPUT_TYPE_INVALID,
00047   STP_OUTPUT_TYPE_GRAYSCALE,
00048   STP_OUTPUT_TYPE_WHITESCALE,
00049   STP_OUTPUT_TYPE_RGB,
00050   STP_OUTPUT_TYPE_CMY,
00051   STP_OUTPUT_TYPE_CMYK,
00052   STP_OUTPUT_TYPE_CMYKRB,
00053   STP_OUTPUT_TYPE_RAW
00054 } stp_output_type_t;
00055 #endif
00056 
00057 typedef struct
00058 {
00059   int (*init)(stp_vars_t v, stp_image_t *image, size_t steps);
00060   int (*get_row)(stp_vars_t v, stp_image_t *image,
00061                  int row, unsigned *zero_mask);
00062   stp_parameter_list_t (*list_parameters)(stp_const_vars_t v);
00063   void (*describe_parameter)(stp_const_vars_t v, const char *name,
00064                              stp_parameter_t *description);
00065 } stpi_colorfuncs_t;
00066 
00067 
00068 #define COOKIE_COLOR   0x05d892e2
00069 
00070 typedef struct stpi_internal_color
00071 {
00072   int        cookie;            /* Magic number */
00073   const char *short_name;       /* Color module name */
00074   const char *long_name;        /* Long name for UI */
00075   const stpi_colorfuncs_t *colorfuncs;
00076 } stpi_internal_color_t;
00077 
00078 
00079 /*
00080  * Initialize the color machinery.  Return value is the number
00081  * of columns of output
00082  */
00083 extern int stpi_color_init(stp_vars_t v, stp_image_t *image, size_t steps);
00084 
00085 /*
00086  * Acquire input and perform color conversion.  Return value
00087  * is status; zero is success.
00088  */
00089 extern int stpi_color_get_row(stp_vars_t v, stp_image_t *image,
00090                               int row, unsigned *zero_mask);
00091 
00092 extern stp_parameter_list_t stpi_color_list_parameters(stp_const_vars_t v);
00093 
00094 extern void stpi_color_describe_parameter(stp_const_vars_t v, const char *name,
00095                                           stp_parameter_t *description);
00096 
00097 extern void stpi_channel_reset(stp_vars_t v);
00098 extern void stpi_channel_reset_channel(stp_vars_t v, int channel);
00099 
00100 extern void stpi_channel_add(stp_vars_t v, unsigned channel,
00101                              unsigned subchannel, double value);
00102 
00103 extern void stpi_channel_set_density_adjustment(stp_vars_t v,
00104                                                 int color, int subchannel,
00105                                                 double adjustment);
00106 extern void stpi_channel_set_ink_limit(stp_vars_t v, double limit);
00107 extern void stpi_channel_set_cutoff_adjustment(stp_vars_t v,
00108                                                int color, int subchannel,
00109                                                double adjustment);
00110 extern void stpi_channel_set_black_channel(stp_vars_t v, int channel);
00111 
00112 extern void stpi_channel_initialize(stp_vars_t v, stp_image_t *image,
00113                                     int input_channel_count);
00114 
00115 extern void stpi_channel_convert(stp_const_vars_t v, unsigned *zero_mask);
00116 
00117 extern unsigned short * stpi_channel_get_input(stp_const_vars_t v);
00118 
00119 extern unsigned short * stpi_channel_get_output(stp_const_vars_t v);
00120 
00121 
00122 
00123 extern stp_const_color_t
00124 stpi_get_color_by_colorfuncs(stpi_colorfuncs_t *colorfuncs);
00125 
00126 extern int
00127 stpi_color_register(const stpi_internal_color_t *color);
00128 
00129 extern int
00130 stpi_color_unregister(const stpi_internal_color_t *color);
00131 
00132 #ifdef __cplusplus
00133   }
00134 #endif
00135 
00136 #endif /* GIMP_PRINT_INTERNAL_COLOR_H */

Generated on Sat Apr 17 15:42:11 2004 for libgimpprint API Reference by doxygen1.2.17