1 /* 2 * Image library definitions for CUPS. 3 * 4 * Copyright 2007-2011 by Apple Inc. 5 * Copyright 1993-2006 by Easy Software Products. 6 * 7 * These coded instructions, statements, and computer programs are the 8 * property of Apple Inc. and are protected by Federal copyright 9 * law. Distribution and use rights are outlined in the file "COPYING" 10 * which should have been included with this file. 11 */ 12 13 #ifndef _CUPS_FILTERS_IMAGE_H_ 14 # define _CUPS_FILTERS_IMAGE_H_ 15 16 /* 17 * Include necessary headers... 18 */ 19 20 # include <stdio.h> 21 # include <cups/raster.h> 22 23 # ifdef __cplusplus 24 extern "C" { 25 # endif /* __cplusplus */ 26 27 /* 28 * Constants... 29 */ 30 31 typedef enum cups_icspace_e /**** Image colorspaces ****/ 32 { 33 CUPS_IMAGE_CMYK = -4, /* Cyan, magenta, yellow, and black */ 34 CUPS_IMAGE_CMY = -3, /* Cyan, magenta, and yellow */ 35 CUPS_IMAGE_BLACK = -1, /* Black */ 36 CUPS_IMAGE_WHITE = 1, /* White (luminance) */ 37 CUPS_IMAGE_RGB = 3, /* Red, green, and blue */ 38 CUPS_IMAGE_RGB_CMYK = 4 /* Use RGB or CMYK */ 39 } cups_icspace_t; 40 41 42 /* 43 * Types and structures... 44 */ 45 46 typedef unsigned char cups_ib_t; /**** Image byte ****/ 47 48 struct cups_image_s; 49 typedef struct cups_image_s cups_image_t; 50 /**** Image file data ****/ 51 52 struct cups_izoom_s; 53 typedef struct cups_izoom_s cups_izoom_t; 54 /**** Image zoom data ****/ 55 56 57 /* 58 * Prototypes... 59 */ 60 61 extern void cupsImageClose(cups_image_t *img) _CUPS_API_1_2; 62 extern void cupsImageCMYKToBlack(const cups_ib_t *in, 63 cups_ib_t *out, int count) _CUPS_API_1_2; 64 extern void cupsImageCMYKToCMY(const cups_ib_t *in, 65 cups_ib_t *out, int count) _CUPS_API_1_2; 66 extern void cupsImageCMYKToCMYK(const cups_ib_t *in, 67 cups_ib_t *out, int count) _CUPS_API_1_2; 68 extern void cupsImageCMYKToRGB(const cups_ib_t *in, 69 cups_ib_t *out, int count) _CUPS_API_1_2; 70 extern void cupsImageCMYKToWhite(const cups_ib_t *in, 71 cups_ib_t *out, int count) _CUPS_API_1_2; 72 extern int cupsImageGetCol(cups_image_t *img, int x, int y, 73 int height, cups_ib_t *pixels) _CUPS_API_1_2; 74 extern cups_icspace_t cupsImageGetColorSpace(cups_image_t *img) _CUPS_API_1_2; 75 extern int cupsImageGetDepth(cups_image_t *img) _CUPS_API_1_2; 76 extern unsigned cupsImageGetHeight(cups_image_t *img) _CUPS_API_1_2; 77 extern int cupsImageGetRow(cups_image_t *img, int x, int y, 78 int width, cups_ib_t *pixels) _CUPS_API_1_2; 79 extern unsigned cupsImageGetWidth(cups_image_t *img) _CUPS_API_1_2; 80 extern unsigned cupsImageGetXPPI(cups_image_t *img) _CUPS_API_1_2; 81 extern unsigned cupsImageGetYPPI(cups_image_t *img) _CUPS_API_1_2; 82 extern void cupsImageLut(cups_ib_t *pixels, int count, 83 const cups_ib_t *lut) _CUPS_API_1_2; 84 extern cups_image_t *cupsImageOpen(const char *filename, 85 cups_icspace_t primary, 86 cups_icspace_t secondary, 87 int saturation, int hue, 88 const cups_ib_t *lut) _CUPS_API_1_2; 89 extern void cupsImageRGBAdjust(cups_ib_t *pixels, int count, 90 int saturation, int hue) _CUPS_API_1_2; 91 extern void cupsImageRGBToBlack(const cups_ib_t *in, 92 cups_ib_t *out, int count) _CUPS_API_1_2; 93 extern void cupsImageRGBToCMY(const cups_ib_t *in, 94 cups_ib_t *out, int count) _CUPS_API_1_2; 95 extern void cupsImageRGBToCMYK(const cups_ib_t *in, 96 cups_ib_t *out, int count) _CUPS_API_1_2; 97 extern void cupsImageRGBToRGB(const cups_ib_t *in, 98 cups_ib_t *out, int count) _CUPS_API_1_2; 99 extern void cupsImageRGBToWhite(const cups_ib_t *in, 100 cups_ib_t *out, int count) _CUPS_API_1_2; 101 extern void cupsImageSetMaxTiles(cups_image_t *img, int max_tiles) _CUPS_API_1_2; 102 extern void cupsImageSetProfile(float d, float g, 103 float matrix[3][3]) _CUPS_API_1_2; 104 extern void cupsImageSetRasterColorSpace(cups_cspace_t cs) _CUPS_API_1_2; 105 extern void cupsImageWhiteToBlack(const cups_ib_t *in, 106 cups_ib_t *out, int count) _CUPS_API_1_2; 107 extern void cupsImageWhiteToCMY(const cups_ib_t *in, 108 cups_ib_t *out, int count) _CUPS_API_1_2; 109 extern void cupsImageWhiteToCMYK(const cups_ib_t *in, 110 cups_ib_t *out, int count) _CUPS_API_1_2; 111 extern void cupsImageWhiteToRGB(const cups_ib_t *in, 112 cups_ib_t *out, int count) _CUPS_API_1_2; 113 extern void cupsImageWhiteToWhite(const cups_ib_t *in, 114 cups_ib_t *out, int count) _CUPS_API_1_2; 115 extern cups_image_t* cupsImageCrop(cups_image_t* img,int posw, 116 int posh,int width,int height); 117 118 # ifdef __cplusplus 119 } 120 # endif /* __cplusplus */ 121 122 #endif /* !_CUPS_FILTERS_IMAGE_H_ */ 123 124