1 /*****************************************************************************\
2 LJFastRaster.h : Interface for the LJFastRaster class
4 Copyright (c) 1996 - 2001, Hewlett-Packard Co.
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. Neither the name of Hewlett-Packard nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
20 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
22 NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 \*****************************************************************************/
32 #ifndef APDK_LJFASTRASTER_H
33 #define APDK_LJFASTRASTER_H
40 class LJFastRaster : public Printer
43 LJFastRaster (SystemServices* pSS,int numfonts=0, BOOL proto=FALSE);
46 virtual Header* SelectHeader (PrintContext* pc);
47 virtual DRIVER_ERROR VerifyPenInfo ();
48 virtual DRIVER_ERROR ParsePenInfo (PEN_TYPE& ePen, BOOL QueryPrinter=TRUE);
49 virtual DISPLAY_STATUS ParseError (BYTE status_reg);
50 virtual DRIVER_ERROR Flush (int FlushSize)
55 virtual BOOL GetMargins (PAPER_SIZE ps, float *fMargins)
57 fMargins[0] = (float) 0.1667;
58 fMargins[1] = (float) 0.1667;
59 fMargins[2] = (float) 0.1667;
60 fMargins[3] = (float) 0.1667;
64 virtual BOOL UseCMYK (unsigned int iPrintMode) { return FALSE;}
65 virtual DRIVER_ERROR Encapsulate (const RASTERDATA* InputRaster, BOOL bLastPlane);
66 virtual BOOL SupportSeparateBlack (PrintMode *pCurrentMode)
71 Compressor* CreateCompressor (unsigned int RasterSize);
73 BOOL m_bStartPageNotSent;
75 HeaderLJFastRaster *phLJFastRaster;
79 virtual LJFastRaster & operator = (Printer& rhs)
85 virtual DATA_FORMAT GetDataFormat() { return RASTER_STRIP; }
89 Compressor *m_pCompressor;
92 class LJFastRasterNormalMode : public GrayMode
95 LJFastRasterNormalMode ();
96 }; // LJFastRasterNormalMode
98 class LJFastRasterDraftMode : public GrayMode
101 LJFastRasterDraftMode ();
102 }; // LJFastRasterDraftMode
110 #define HIBYTE(sVar) (BYTE) ((sVar & 0xFF00) >> 8)
111 #define LOBYTE(sVar) (BYTE) ((sVar & 0x00FF))
113 class ModeDeltaPlus : public Compressor
115 friend class LJFastRaster;
116 friend class HeaderLJFastRaster;
119 ModeDeltaPlus(SystemServices* pSys, Printer* pPrinter, unsigned int RasterSize);
120 virtual ~ModeDeltaPlus();
121 BOOL Process(RASTERDATA* input);
122 BYTE* NextOutputRaster(COLORTYPE color);
123 unsigned int GetOutputWidth(COLORTYPE color);
126 BOOL Compress(HPUInt8* outmem, uint32_t* outlen, const HPUInt8* inmem, const uint32_t row_width, const uint32_t inheight, uint32_t horz_ht_dist);
130 HPUInt8* encode_header(HPUInt8* outptr, const HPUInt8* pastoutmem, uint32_t isrun, uint32_t location, uint32_t seedrow_count, uint32_t run_count, const HPUInt8 new_color);
132 unsigned char *pbyInputImageBuffer;
134 HPLJBITMAP m_DestBitmap;;
135 long m_lCurrCDRasterRow; // Current raster index. in PrintNextBand
136 long m_lCurrBlockHeight;
137 long m_lPrinterRasterRow; // Current printer raster row.
139 uint32_t m_compressedsize;
146 #ifdef APDK_LJFASTRASTER
147 //! LJFastRasterProxy
149 ******************************************************************************/
150 class LJFastRasterProxy : public PrinterProxy
153 LJFastRasterProxy () : PrinterProxy(
154 "LJFastRaster", // family name
158 * The 1015 also supports a PCL path. It will be used a a LJMono printer.
164 m_iPrinterType = eLJFastRaster;
166 inline Printer* CreatePrinter (SystemServices* pSS) const
168 return new LJFastRaster(pSS);
170 inline PRINTER_TYPE GetPrinterType () const
172 return eLJFastRaster;
174 inline unsigned int GetModelBit () const
183 #endif //APDK_LJFASTRASTER_H