#ifndef _CUPS_IMAGE_PRIVATE_H_
# define _CUPS_IMAGE_PRIVATE_H_
# include "image.h"
# include "raster.h"
# include <cups/cups.h>
# include <cups/debug.h>
# include <cups/string.h>
# include <stdlib.h>
# include <string.h>
# include <unistd.h>
# include <errno.h>
# include <math.h>
# define CUPS_IMAGE_MAX_WIDTH 0x07ffffff
# define CUPS_IMAGE_MAX_HEIGHT 0x7fffffff
# define CUPS_TILE_SIZE 256
# define CUPS_TILE_MINIMUM 10
# ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))
# endif
# ifndef min
# define min(a,b) ((a) < (b) ? (a) : (b))
# endif
# ifndef abs
# define abs(a) ((a) < 0 ? -(a) : (a))
# endif
typedef enum cups_iztype_e
{
CUPS_IZOOM_FAST,
CUPS_IZOOM_NORMAL,
CUPS_IZOOM_BEST
} cups_iztype_t;
struct cups_ic_s;
typedef struct cups_itile_s
{
int dirty;
long pos;
struct cups_ic_s *ic;
} cups_itile_t;
typedef struct cups_ic_s
{
struct cups_ic_s *prev,
*next;
cups_itile_t *tile;
cups_ib_t *pixels;
} cups_ic_t;
struct cups_image_s
{
cups_icspace_t colorspace;
unsigned xsize,
ysize,
xppi,
yppi,
num_ics,
max_ics;
cups_itile_t **tiles;
cups_ic_t *first,
*last;
FILE *cachefile;
char cachename[256];
};
struct cups_izoom_s
{
cups_image_t *img;
cups_iztype_t type;
unsigned xorig,
yorig,
width,
height,
depth,
rotated,
xsize,
ysize,
xmax,
ymax,
xmod,
ymod;
int xstep,
xincr,
instep,
inincr,
ystep,
yincr,
row;
cups_ib_t *rows[2],
*in;
};
extern int _cupsImagePutCol(cups_image_t *img, int x, int y,
int height, const cups_ib_t *pixels);
extern int _cupsImagePutRow(cups_image_t *img, int x, int y,
int width, const cups_ib_t *pixels);
extern int _cupsImageReadBMP(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadFPX(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadGIF(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadJPEG(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadPIX(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadPNG(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadPNM(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadPhotoCD(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadSGI(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadSunRaster(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern int _cupsImageReadTIFF(cups_image_t *img, FILE *fp,
cups_icspace_t primary,
cups_icspace_t secondary,
int saturation, int hue,
const cups_ib_t *lut);
extern void _cupsImageZoomDelete(cups_izoom_t *z);
extern void _cupsImageZoomFill(cups_izoom_t *z, int iy);
extern cups_izoom_t *_cupsImageZoomNew(cups_image_t *img, int xc0, int yc0,
int xc1, int yc1, int xsize,
int ysize, int rotated,
cups_iztype_t type);
extern int _cupsRasterExecPS(cups_page_header2_t *h,
int *preferred_bits,
const char *code);
extern void _cupsRasterAddError(const char *f, ...);
extern void _cupsRasterClearError(void);
#endif