diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-10-10 20:22:24 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-10-10 20:22:24 -0400 |
commit | dd204f7a5030aec83a0c38f695c4bba84a49e4f4 (patch) | |
tree | eff3c3e3e8a0b220d837a611bfb44976adb3efe9 /cups/raster-private.h | |
parent | 11ea1663d55f27e27fafc149f933fb764015f648 (diff) | |
download | cups-dd204f7a5030aec83a0c38f695c4bba84a49e4f4.tar.gz |
Move raster functions into libcups, with stubs that call back to libcups in libcupsimage.
Diffstat (limited to 'cups/raster-private.h')
-rw-r--r-- | cups/raster-private.h | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/cups/raster-private.h b/cups/raster-private.h index 0cca21f9a..1852341b7 100644 --- a/cups/raster-private.h +++ b/cups/raster-private.h @@ -27,8 +27,45 @@ # include <fcntl.h> # endif /* _WIN32 */ +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + /* + * Structure... + */ + +struct _cups_raster_s /**** Raster stream data ****/ +{ + unsigned sync; /* Sync word from start of stream */ + void *ctx; /* File descriptor */ + cups_raster_iocb_t iocb; /* IO callback */ + cups_mode_t mode; /* Read/write mode */ + cups_page_header2_t header; /* Raster header for current page */ + unsigned rowheight, /* Row height in lines */ + count, /* Current row run-length count */ + remaining, /* Remaining rows in page image */ + bpp; /* Bytes per pixel/color */ + unsigned char *pixels, /* Pixels for current row */ + *pend, /* End of pixel buffer */ + *pcurrent; /* Current byte in pixel buffer */ + int compressed, /* Non-zero if data is compressed */ + swapped; /* Non-zero if data is byte-swapped */ + unsigned char *buffer, /* Read/write buffer */ + *bufptr, /* Current (read) position in buffer */ + *bufend; /* End of current (read) buffer */ + size_t bufsize; /* Buffer size */ +# ifdef DEBUG + size_t iostart, /* Start of read/write buffer */ + iocount; /* Number of bytes read/written */ +# endif /* DEBUG */ + unsigned apple_page_count;/* Apple raster page count */ +}; + + +#if 0 +/* * min/max macros... */ @@ -38,14 +75,28 @@ # ifndef min # define min(a,b) ((a) < (b) ? (a) : (b)) # endif /* !min */ +#endif // 0 /* * Prototypes... */ -extern int _cupsRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code) _CUPS_NONNULL(3) _CUPS_PRIVATE; extern void _cupsRasterAddError(const char *f, ...) _CUPS_FORMAT(1,2) _CUPS_PRIVATE; extern void _cupsRasterClearError(void) _CUPS_PRIVATE; +extern const char *_cupsRasterColorSpaceString(cups_cspace_t cspace) _CUPS_PRIVATE; +extern void _cupsRasterDelete(cups_raster_t *r) _CUPS_PRIVATE; +extern const char *_cupsRasterErrorString(void) _CUPS_PRIVATE; +extern int _cupsRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code) _CUPS_NONNULL(3) _CUPS_PRIVATE; +extern int _cupsRasterInitPWGHeader(cups_page_header2_t *h, pwg_media_t *media, const char *type, int xdpi, int ydpi, const char *sides, const char *sheet_back) _CUPS_PRIVATE; +extern cups_raster_t *_cupsRasterNew(cups_raster_iocb_t iocb, void *ctx, cups_mode_t mode) _CUPS_PRIVATE; +extern unsigned _cupsRasterReadHeader(cups_raster_t *r) _CUPS_PRIVATE; +extern unsigned _cupsRasterReadPixels(cups_raster_t *r, unsigned char *p, unsigned len) _CUPS_PRIVATE; +extern unsigned _cupsRasterWriteHeader(cups_raster_t *r) _CUPS_PRIVATE; +extern unsigned _cupsRasterWritePixels(cups_raster_t *r, unsigned char *p, unsigned len) _CUPS_PRIVATE; + +# ifdef __cplusplus +} +# endif /* __cplusplus */ #endif /* !_CUPS_RASTER_PRIVATE_H_ */ |