xref: /haiku/src/add-ons/print/drivers/pcl6/PCL6.h (revision 93aeb8c3bc3f13cb1f282e3e749258a23790d947)
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 "PCL6Writer.h"
13 
14 class Halftone;
15 
16 class PCL6Driver : public GraphicsDriver, public PCL6WriterStream
17 {
18 public:
19 	PCL6Driver(BMessage *msg, PrinterData *printer_data, const PrinterCap *printer_cap);
20 
21 	void write(const uint8 *data, uint32 size);
22 
23 protected:
24 	virtual bool startDoc();
25 	virtual bool startPage(int page);
26 	virtual bool nextBand(BBitmap *bitmap, BPoint *offset);
27 	virtual bool endPage(int page);
28 	virtual bool endDoc(bool success);
29 
30 private:
31 	bool supportsDeltaRowCompression();
32 	PCL6Writer::MediaSize mediaSize(JobData::Paper paper);
33 	PCL6Writer::MediaSource mediaSource(JobData::PaperSource source);
34 	void move(int x, int y);
35 	void jobStart();
36 	void writeBitmap(const uchar* buffer, int outSize, int rowSize, int x, int y, int width, int height, int deltaRowSize);
37 	void startRasterGraphics(int x, int y, int width, int height, PCL6Writer::Compression compressionMethod);
38 	void endRasterGraphics();
39 	void rasterGraphics(
40 		const uchar *buffer,
41 		int bufferSize,
42 		int dataSize,
43 		int rowSize,
44 		int height,
45 		int compression_method);
46 	void jobEnd();
47 
48 	PCL6Writer            *fWriter;
49 	PCL6Writer::MediaSide fMediaSide; // side if in duplex mode
50 	Halftone              *fHalftone;
51 };
52 
53 #endif	/* __PCL6_H */
54