1 /*****************************************************************************\
\r
2 HPCupsFilter.h : Interface for HPCupsFilter class
\r
4 Copyright (c) 1996 - 2009, Hewlett-Packard Co.
\r
7 Redistribution and use in source and binary forms, with or without
\r
8 modification, are permitted provided that the following conditions
\r
10 1. Redistributions of source code must retain the above copyright
\r
11 notice, this list of conditions and the following disclaimer.
\r
12 2. Redistributions in binary form must reproduce the above copyright
\r
13 notice, this list of conditions and the following disclaimer in the
\r
14 documentation and/or other materials provided with the distribution.
\r
15 3. Neither the name of Hewlett-Packard nor the names of its
\r
16 contributors may be used to endorse or promote products derived
\r
17 from this software without specific prior written permission.
\r
19 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
\r
20 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
21 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
\r
22 NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
\r
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
\r
24 TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
\r
25 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
\r
26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
\r
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
\r
28 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
29 \*****************************************************************************/
\r
31 #ifndef HP_CUPSFILTER_H
\r
32 #define HP_CUPSFILTER_H
\r
34 #include "CommonDefinitions.h"
\r
35 #include "SystemServices.h"
\r
36 #include "Compressor.h"
\r
39 #include "dbuscomm.h"
\r
41 #define DBITMAPFILEHEADER 14
\r
42 #define DBITMAPINFOHEADER 40
\r
68 int biXPelsPerMeter;
\r
69 int biYPelsPerMeter;
\r
80 int StartPrintJob(int argc, char *argv[]);
\r
82 void RemoveStatus();
\r
84 void WriteBMPHeader (FILE *fp, int width, int height, eRasterType raster_type);
\r
85 void WriteBMPRaster (FILE *fp, BYTE *raster, int width, eRasterType raster_type);
\r
89 BYTE *m_pPrinterBuffer;
\r
91 SystemServices *m_pSys;
\r
96 DBusCommunicator m_DBusComm;
\r
100 void closeFilter();
\r
102 void getLogLevel();
\r
103 DRIVER_ERROR startPage (cups_page_header2_t *header);
\r
104 int processRasterData(cups_raster_t *cups_raster);
\r
105 void extractBlackPixels(cups_page_header2_t *cups_header,
\r
106 BYTE *kRaster, BYTE *rgbRaster);
\r
107 void printCupsHeaderInfo(cups_page_header2_t *header);
\r
108 bool isBlankRaster(BYTE *input_raster, cups_page_header2_t *header);
\r
111 void CreateBMPHeader(int width, int height, int planes, int bpp);
\r
112 void WriteCBMPHeader (FILE *fp, int width, int height);
\r
113 void WriteKBMPHeader (FILE *fp, int width, int height);
\r
114 void WriteCBMPRaster (FILE *fp, BYTE *rgb_raster, int width);
\r
115 void WriteKBMPRaster (FILE *fp, BYTE *k_raster, int width);
\r
118 BYTE *black_raster;
\r
119 BYTE *color_raster;
\r
120 BITMAPFILEHEADER bmfh;
\r
121 BITMAPINFOHEADER bmih;
\r
124 #endif // HP_CUPSFILTER_H
\r