1 /* 2 * PCL6.h 3 * Copyright 1999-2000 Y.Takagi. All Rights Reserved. 4 * Copyright 2003 Michael Pfeiffer. 5 */ 6 7 #ifndef __PCL6_H 8 #define __PCL6_H 9 10 11 #include "GraphicsDriver.h" 12 #include "PCL6Cap.h" 13 #include "PCL6Writer.h" 14 15 class Halftone; 16 17 class PCL6Driver : public GraphicsDriver, public PCL6WriterStream 18 { 19 public: 20 PCL6Driver(BMessage *msg, PrinterData *printer_data, const PrinterCap *printer_cap); 21 22 void write(const uint8 *data, uint32 size); 23 24 protected: 25 virtual bool startDoc(); 26 virtual bool startPage(int page); 27 virtual bool nextBand(BBitmap *bitmap, BPoint *offset); 28 virtual bool endPage(int page); 29 virtual bool endDoc(bool success); 30 31 private: 32 bool supportsRLECompression(); 33 bool supportsDeltaRowCompression(); 34 bool useColorMode(); 35 PCL6Writer::MediaSize mediaSize(JobData::Paper paper); 36 PCL6Writer::MediaSource mediaSource(JobData::PaperSource source); 37 void move(int x, int y); 38 void jobStart(); 39 void writeBitmap(const uchar* buffer, int outSize, int rowSize, int x, int y, int width, int height, int deltaRowSize); 40 void startRasterGraphics(int x, int y, int width, int height, PCL6Writer::Compression compressionMethod); 41 void endRasterGraphics(); 42 void rasterGraphics( 43 const uchar *buffer, 44 int bufferSize, 45 int dataSize, 46 int rowSize, 47 int height, 48 int compression_method); 49 void jobEnd(); 50 51 PCL6Writer *fWriter; 52 PCL6Writer::MediaSide fMediaSide; // side if in duplex mode 53 Halftone *fHalftone; 54 }; 55 56 #endif /* __PCL6_H */ 57