#ifndef __GIMP_PRINT_H__
#define __GIMP_PRINT_H__
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GIMPPRINT_MAJOR_VERSION (4)
#define GIMPPRINT_MINOR_VERSION (2)
#define GIMPPRINT_MICRO_VERSION (5)
#define GIMPPRINT_CURRENT_INTERFACE (2)
#define GIMPPRINT_BINARY_AGE (1)
#define GIMPPRINT_INTERFACE_AGE (0)
#define GIMPPRINT_CHECK_VERSION(major,minor,micro) \
(GIMPPRINT_MAJOR_VERSION > (major) || \
(GIMPPRINT_MAJOR_VERSION == (major) && GIMPPRINT_MINOR_VERSION > (minor)) || \
(GIMPPRINT_MAJOR_VERSION == (major) && GIMPPRINT_MINOR_VERSION == (minor) && \
GIMPPRINT_MICRO_VERSION >= (micro)))
extern const unsigned int gimpprint_major_version;
extern const unsigned int gimpprint_minor_version;
extern const unsigned int gimpprint_micro_version;
extern const unsigned int gimpprint_current_interface;
extern const unsigned int gimpprint_binary_age;
extern const unsigned int gimpprint_interface_age;
extern const char* stp_check_version (unsigned int required_major,
unsigned int required_minor,
unsigned int required_micro);
#define OUTPUT_GRAY 0
#define OUTPUT_COLOR 1
#define OUTPUT_MONOCHROME 2
#define OUTPUT_RAW_CMYK 3
#define ORIENT_AUTO -1
#define ORIENT_PORTRAIT 0
#define ORIENT_LANDSCAPE 1
#define ORIENT_UPSIDEDOWN 2
#define ORIENT_SEASCAPE 3
#define IMAGE_LINE_ART 0
#define IMAGE_SOLID_TONE 1
#define IMAGE_CONTINUOUS 2
#define NIMAGE_TYPES 3
#define COLOR_MODEL_RGB 0
#define COLOR_MODEL_CMY 1
#define NCOLOR_MODELS 2
typedef enum stp_papersize_unit
{
PAPERSIZE_ENGLISH,
PAPERSIZE_METRIC
} stp_papersize_unit_t;
typedef enum
{
STP_JOB_MODE_PAGE,
STP_JOB_MODE_JOB
} stp_job_mode_t;
typedef enum stp_image_status
{
STP_IMAGE_OK,
STP_IMAGE_ABORT
} stp_image_status_t;
typedef struct stp_image
{
void (*init)(struct stp_image *image);
void (*reset)(struct stp_image *image);
void (*transpose)(struct stp_image *image);
void (*hflip)(struct stp_image *image);
void (*vflip)(struct stp_image *image);
void (*crop)(struct stp_image *image,
int left, int top, int right, int bottom);
void (*rotate_ccw)(struct stp_image *image);
void (*rotate_cw)(struct stp_image *image);
void (*rotate_180)(struct stp_image *image);
int (*bpp)(struct stp_image *image);
int (*width)(struct stp_image *image);
int (*height)(struct stp_image *image);
stp_image_status_t (*get_row)(struct stp_image *image, unsigned char *data,
int row);
const char *(*get_appname)(struct stp_image *image);
void (*progress_init)(struct stp_image *image);
void (*note_progress)(struct stp_image *image, double current, double total);
void (*progress_conclude)(struct stp_image *image);
void *rep;
} stp_image_t;
typedef void *stp_printer_t;
typedef void *stp_vars_t;
typedef void *stp_papersize_t;
typedef struct
{
const char *name,
*text;
} stp_param_t;
typedef void (*stp_outfunc_t) (void *data, const char *buffer, size_t bytes);
typedef struct
{
stp_param_t *(*parameters)(const stp_printer_t printer,
const char *ppd_file,
const char *name, int *count);
void (*media_size)(const stp_printer_t printer, const stp_vars_t v,
int *width, int *height);
void (*imageable_area)(const stp_printer_t printer,
const stp_vars_t v,
int *left, int *right, int *bottom, int *top);
void (*limit)(const stp_printer_t printer, const stp_vars_t v,
int *max_width, int *max_height,
int *min_width, int *min_height);
void (*print)(const stp_printer_t printer,
stp_image_t *image, const stp_vars_t v);
const char *(*default_parameters)(const stp_printer_t printer,
const char *ppd_file,
const char *name);
void (*describe_resolution)(const stp_printer_t printer,
const char *resolution, int *x, int *y);
int (*verify)(const stp_printer_t p, const stp_vars_t v);
int (*start_job)(const stp_printer_t printer,
stp_image_t *image, const stp_vars_t v);
int (*end_job)(const stp_printer_t printer,
stp_image_t *image, const stp_vars_t v);
} stp_printfuncs_t;
extern int stp_init (void);
extern const char * stp_printer_get_long_name (const stp_printer_t p);
extern const char * stp_printer_get_driver (const stp_printer_t p);
extern int stp_printer_get_model (const stp_printer_t p);
extern const stp_printfuncs_t *stp_printer_get_printfuncs(const stp_printer_t);
extern const stp_vars_t stp_printer_get_printvars (const stp_printer_t p);
extern void stp_set_printer_defaults(stp_vars_t, const stp_printer_t,
const char *ppd_file);
extern stp_vars_t stp_allocate_vars (void);
extern void stp_copy_vars (stp_vars_t vd, const stp_vars_t vs);
extern stp_vars_t stp_allocate_copy (const stp_vars_t vs);
extern void stp_free_vars (stp_vars_t vv);
extern void stp_set_output_to (stp_vars_t vv, const char *val);
extern void stp_set_driver (stp_vars_t vv, const char *val);
extern void stp_set_ppd_file (stp_vars_t vv, const char *val);
extern void stp_set_resolution (stp_vars_t vv, const char *val);
extern void stp_set_media_size (stp_vars_t vv, const char *val);
extern void stp_set_media_type (stp_vars_t vv, const char *val);
extern void stp_set_media_source (stp_vars_t vv, const char *val);
extern void stp_set_ink_type (stp_vars_t vv, const char *val);
extern void stp_set_dither_algorithm (stp_vars_t vv, const char *val);
extern void stp_set_output_to_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_driver_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_ppd_file_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_resolution_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_media_size_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_media_type_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_media_source_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_ink_type_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_dither_algorithm_n (stp_vars_t vv, const char *val,
int bytes);
extern void stp_set_output_type (stp_vars_t vv, int val);
extern void stp_set_orientation (stp_vars_t vv, int val);
extern void stp_set_left (stp_vars_t vv, int val);
extern void stp_set_top (stp_vars_t vv, int val);
extern void stp_set_image_type (stp_vars_t vv, int val);
extern void stp_set_unit (stp_vars_t vv, int val);
extern void stp_set_page_width (stp_vars_t vv, int val);
extern void stp_set_page_height (stp_vars_t vv, int val);
extern void stp_set_input_color_model (stp_vars_t vv, int val);
extern void stp_set_output_color_model (stp_vars_t vv, int val);
extern void stp_set_brightness (stp_vars_t vv, float val);
extern void stp_set_scaling (stp_vars_t vv, float val);
extern void stp_set_gamma (stp_vars_t vv, float val);
extern void stp_set_contrast (stp_vars_t vv, float val);
extern void stp_set_cyan (stp_vars_t vv, float val);
extern void stp_set_magenta (stp_vars_t vv, float val);
extern void stp_set_yellow (stp_vars_t vv, float val);
extern void stp_set_saturation (stp_vars_t vv, float val);
extern void stp_set_density (stp_vars_t vv, float val);
extern void stp_set_app_gamma (stp_vars_t vv, float val);
extern void stp_set_lut (stp_vars_t vv, void * val);
extern void stp_set_cmap (stp_vars_t vv, unsigned char * val);
extern void stp_set_outfunc (const stp_vars_t vv, stp_outfunc_t val);
extern void stp_set_errfunc (const stp_vars_t vv, stp_outfunc_t val);
extern void stp_set_outdata (stp_vars_t vv, void * val);
extern void stp_set_errdata (stp_vars_t vv, void * val);
extern const char * stp_get_output_to (const stp_vars_t vv);
extern const char * stp_get_driver (const stp_vars_t vv);
extern const char * stp_get_ppd_file (const stp_vars_t vv);
extern const char * stp_get_resolution (const stp_vars_t vv);
extern const char * stp_get_media_size (const stp_vars_t vv);
extern const char * stp_get_media_type (const stp_vars_t vv);
extern const char * stp_get_media_source (const stp_vars_t vv);
extern const char * stp_get_ink_type (const stp_vars_t vv);
extern const char * stp_get_dither_algorithm (const stp_vars_t vv);
extern int stp_get_output_type (const stp_vars_t vv);
extern int stp_get_orientation (const stp_vars_t vv);
extern int stp_get_left (const stp_vars_t vv);
extern int stp_get_top (const stp_vars_t vv);
extern int stp_get_image_type (const stp_vars_t vv);
extern int stp_get_unit (const stp_vars_t vv);
extern int stp_get_page_width (const stp_vars_t vv);
extern int stp_get_page_height (const stp_vars_t vv);
extern int stp_get_input_color_model (const stp_vars_t vv);
extern int stp_get_output_color_model (const stp_vars_t vv);
extern float stp_get_brightness (const stp_vars_t vv);
extern float stp_get_scaling (const stp_vars_t vv);
extern float stp_get_gamma (const stp_vars_t vv);
extern float stp_get_contrast (const stp_vars_t vv);
extern float stp_get_cyan (const stp_vars_t vv);
extern float stp_get_magenta (const stp_vars_t vv);
extern float stp_get_yellow (const stp_vars_t vv);
extern float stp_get_saturation (const stp_vars_t vv);
extern float stp_get_density (const stp_vars_t vv);
extern float stp_get_app_gamma (const stp_vars_t vv);
extern void * stp_get_lut (const stp_vars_t vv);
extern stp_outfunc_t stp_get_outfunc (const stp_vars_t vv);
extern stp_outfunc_t stp_get_errfunc (const stp_vars_t vv);
extern void * stp_get_outdata (const stp_vars_t vv);
extern void * stp_get_errdata (const stp_vars_t vv);
extern unsigned char * stp_get_cmap (const stp_vars_t vv);
typedef void (*stp_convert_t) (const stp_vars_t vars, const unsigned char *in,
unsigned short *out, int *zero_mask,
int width, int bpp, const unsigned char *cmap,
const double *hue_map, const double *lum_map,
const double *sat_map);
extern void stp_merge_printvars (stp_vars_t user, const stp_vars_t print);
extern size_t stp_dither_algorithm_count (void);
extern const char * stp_dither_algorithm_name (int id);
extern const char * stp_dither_algorithm_text (int id);
extern const char * stp_default_dither_algorithm (void);
extern int stp_known_papersizes (void);
extern const stp_papersize_t stp_get_papersize_by_name (const char *name);
extern const stp_papersize_t stp_get_papersize_by_size (int l, int w);
extern const stp_papersize_t stp_get_papersize_by_index (int index);
extern const char * stp_papersize_get_name (const stp_papersize_t pt);
extern const char * stp_papersize_get_text (const stp_papersize_t pt);
extern unsigned stp_papersize_get_width (const stp_papersize_t pt);
extern unsigned stp_papersize_get_height (const stp_papersize_t pt);
extern unsigned stp_papersize_get_top (const stp_papersize_t pt);
extern unsigned stp_papersize_get_left (const stp_papersize_t pt);
extern unsigned stp_papersize_get_bottom (const stp_papersize_t pt);
extern unsigned stp_papersize_get_right (const stp_papersize_t pt);
extern stp_papersize_unit_t stp_papersize_get_unit (const stp_papersize_t pt);
extern void stp_set_job_mode(stp_vars_t, stp_job_mode_t);
extern stp_job_mode_t stp_get_job_mode(const stp_vars_t);
extern void stp_set_page_number(stp_vars_t, int);
extern int stp_get_page_number(const stp_vars_t);
extern int stp_known_printers (void);
extern const stp_printer_t stp_get_printer_by_index (int idx);
extern const stp_printer_t stp_get_printer_by_long_name (const char *long_name);
extern const stp_printer_t stp_get_printer_by_driver (const char *driver);
extern int stp_get_printer_index_by_driver (const char *driver);
extern stp_convert_t stp_choose_colorfunc (int output_type, int image_bpp,
const unsigned char *cmap,
int *out_bpp,
const stp_vars_t v);
extern void stp_allocate_lut (stp_vars_t v, size_t steps);
extern void stp_free_lut (stp_vars_t v);
extern void stp_compute_lut (stp_vars_t v, size_t steps);
extern void stp_compute_page_parameters (int page_right, int page_left,
int page_top, int page_bottom,
double scaling, int image_width,
int image_height, stp_image_t *image,
int *orientation,
int *page_width, int *page_height,
int *out_width, int *out_height,
int *left, int *top);
extern const stp_vars_t stp_default_settings (void);
extern const stp_vars_t stp_maximum_settings (void);
extern const stp_vars_t stp_minimum_settings (void);
#ifdef __cplusplus
}
#endif
#endif