1 /*______________________________ epson-escpage-color.c ______________________________*/
\r
3 /* 1 2 3 4 5 6 7 8 */
\r
4 /*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
\r
5 /*******************************************|********************************************/
\r
7 * Copyright (c) 2010 Seiko Epson Corporation All rights reserved.
\r
9 * Copyright protection claimed includes all forms and matters of
\r
10 * copyrightable material and information now allowed by statutory or judicial
\r
11 * law or hereinafter granted, including without limitation, material generated
\r
12 * from the software programs which are displayed on the screen such as icons,
\r
13 * screen display looks, etc.
\r
17 /*------------------------------------ Includes -------------------------------------*/
\r
18 /*******************************************|********************************************/
\r
19 #include "epson-escpr-err.h"
\r
20 #include "epson-escpr-media.h"
\r
21 #include "epson-escpr-mem.h"
\r
22 #include "epson-escpage.h"
\r
23 #include "epson-escpage-comp.h"
\r
24 #include "epson-escpage-color.h"
\r
26 /*----------------------------- Local Macro Definitions -------------------------------*/
\r
27 /*******************************************|********************************************/
\r
28 #ifdef EPS_LOG_MODULE_PAGE
\r
29 #define EPS_LOG_MODULE EPS_LOG_MODULE_PAGE
\r
31 #define EPS_LOG_MODULE 0
\r
35 /*----------------------------- ESC/PAGE-Color commands -------------------------------*/
\r
36 /*******************************************|********************************************/
\r
37 const static EPS_UINT8 sbCR[] = {0x0D}; /* Carriage return "CR" */
\r
38 const static EPS_UINT8 sbFF[] = {0x0C}; /* Form Feed "FF" */
\r
39 const static EPS_UINT8 sbIP[] = {0x1D, 'r', 'h', 'E'}; /* Initialize printer */
\r
40 const static EPS_UINT8 sbSU150[] = {0x1D, '0', ';', '.', '4', '8', 'm', 'u', 'E'}; /* Set unit to 150 */
\r
41 const static EPS_UINT8 sbSU300[] = {0x1D, '0', ';', '.', '2', '4', 'm', 'u', 'E'}; /* Set unit to 300 */
\r
42 const static EPS_UINT8 sbSU600[] = {0x1D, '0', ';', '.', '1', '2', 'm', 'u', 'E'}; /* Set unit to 600 */
\r
44 const static EPS_UINT8 sbPSSL[] = {0x1D, '3', '0', 'p', 's', 'E'}; /* Set Letter paper */
\r
45 const static EPS_UINT8 sbPSSA4[] = {0x1D, '1', '4', 'p', 's', 'E'}; /* Set A4 paper */
\r
46 const static EPS_UINT8 sbPSSB5[] = {0x1D, '2', '5', 'p', 's', 'E'}; /* Set B5 paper */
\r
47 const static EPS_UINT8 sbPSSLE[] = {0x1D, '3', '2', 'p', 's', 'E'}; /* Set Legal paper */
\r
48 const static EPS_UINT8 sbPSSA3[] = {0x1D, '1', '3', 'p', 's', 'E'}; /* Set A3 paper */
\r
49 const static EPS_UINT8 sbPSSB4[] = {0x1D, '2', '4', 'p', 's', 'E'}; /* Set B4 paper */
\r
50 const static EPS_UINT8 sbPSSPS[] = {0x1D, '3', '8', 'p', 's', 'E'}; /* Set B4 paper */
\r
52 const static EPS_UINT8 sbPTE0[] = {0x1D, '0', 'p', 't', 'E'}; /* select paper type 0:other */
\r
53 const static EPS_UINT8 sbPTE1[] = {0x1D, '1', 'p', 't', 'E'}; /* select paper type 1:plane */
\r
55 const static EPS_UINT8 sbCMS[] = {0x1D, '1', 'c', 'm', 'E'}; /* Clip Mode Set */
\r
56 const static EPS_UINT8 sbSDS600_0[] = {0x1D, '0', ';', '6', '0', '0', ';', '6', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(600) 0:image */
\r
57 const static EPS_UINT8 sbSDS600_1[] = {0x1D, '1', ';', '6', '0', '0', ';', '6', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(600) 1:font */
\r
58 const static EPS_UINT8 sbSDS600_2[] = {0x1D, '2', ';', '6', '0', '0', ';', '6', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(600) 2:binary format pattern */
\r
59 const static EPS_UINT8 sbSDS600_3[] = {0x1D, '3', ';', '6', '0', '0', ';', '6', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(600) 3:color pattern */
\r
60 const static EPS_UINT8 sbSDS300_0[] = {0x1D, '0', ';', '3', '0', '0', ';', '3', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(300) 0:image */
\r
61 const static EPS_UINT8 sbSDS300_1[] = {0x1D, '1', ';', '3', '0', '0', ';', '3', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(300) 1:font */
\r
62 const static EPS_UINT8 sbSDS300_2[] = {0x1D, '2', ';', '3', '0', '0', ';', '3', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(300) 2:binary format pattern */
\r
63 const static EPS_UINT8 sbSDS300_3[] = {0x1D, '3', ';', '3', '0', '0', ';', '3', '0', '0', 'd', 'r', 'E'}; /* Select Dot Size(300) 3:color pattern */
\r
64 const static EPS_UINT8 sbSDS150_0[] = {0x1D, '0', ';', '1', '5', '0', ';', '1', '5', '0', 'd', 'r', 'E'}; /* Select Dot Size(150) 0:image */
\r
65 const static EPS_UINT8 sbSDS150_1[] = {0x1D, '1', ';', '1', '5', '0', ';', '1', '5', '0', 'd', 'r', 'E'}; /* Select Dot Size(150) 1:font */
\r
66 const static EPS_UINT8 sbSDS150_2[] = {0x1D, '2', ';', '1', '5', '0', ';', '1', '5', '0', 'd', 'r', 'E'}; /* Select Dot Size(150) 2:binary format pattern */
\r
67 const static EPS_UINT8 sbSDS150_3[] = {0x1D, '3', ';', '1', '5', '0', ';', '1', '5', '0', 'd', 'r', 'E'}; /* Select Dot Size(150) 3:color pattern */
\r
69 const static EPS_UINT8 sbMMS[] = {0x1D, '0', 'm', 'm', 'E'}; /* Select Page memory mode */
\r
70 const static EPS_UINT8 sbPDS[] = {0x1D, '0', 'p', 'o', 'E'}; /* Set paper direction to normal */
\r
71 const static EPS_UINT8 sbACRLFS[] = {0x1D, '0', 'a', 'l', 'f', 'P'}; /* Does not perform auto carriage return */
\r
72 const static EPS_UINT8 sbAFFS[] = {0x1D, '0', 'a', 'f', 'f', 'P'}; /* Does not perform auto Form Feed */
\r
73 const static EPS_UINT8 sbABPS[] = {0x1D, '1', 'a', 'b', 'P'}; /* Set current position to 0 after bit image draw */
\r
74 const static EPS_UINT8 sbSARGAS[] = {0x1D, '2', 's', 'a', 'r', 'G'}; /* Set Absolute Graph Coordinate mode */
\r
75 const static EPS_UINT8 sbPMPPS[] = {0x1D, '0', 'p', 'm', 'P'}; /* Set current move mode to print pitch mode */
\r
76 const static EPS_UINT8 sbCSE[] = {0x1D, '2', 'c', 's', 'E'}; /* Select color space */
\r
77 const static EPS_UINT8 sbPDDO[] = {0x1D, '0', 'p', 'd', 'd', 'O'}; /* Select Imaging device 0:CPGI 1:PGI */
\r
78 const static EPS_UINT8 sbCCME[] = {0x1D, '0', ';', '2', ';', '4', 'c', 'c', 'm', 'E'}; /* Select color collect */
\r
79 const static EPS_UINT8 sbCAME[] = {0x1D, '7', ';', '0', ';', '2', ';', '3', 'c', 'a', 'm', '{', 'E'};
\r
80 const static EPS_UINT8 sbRAE_1[] = {0x1D, '1', ';', '1', 'r', 'a', 'E'};
\r
81 const static EPS_UINT8 sbRAE_2[] = {0x1D, '2', ';', '1', 'r', 'a', 'E'};
\r
82 const static EPS_UINT8 sbRAE_3[] = {0x1D, '3', ';', '2', 'r', 'a', 'E'};
\r
83 const static EPS_UINT8 sbCMME_0[] = {0x1D, '0', 'c', 'm', 'm', 'E'};
\r
84 const static EPS_UINT8 sbCMME_1[] = {0x1D, '1', 'c', 'm', 'm', 'E'};
\r
85 const static EPS_UINT8 sbCLFP[] = {0x1D, '0', ';', '0', ';', '0', 'c', 'l', 'f', 'P'};
\r
86 const static EPS_UINT8 sbWFE[] = {0x1D, '5', ';', '2', '0', '4', 'w', 'f', 'E'};
\r
88 const static EPS_UINT8 sbBCTI20[] = {0x1D, '2', ';', '2', '0', 'b', 'c', 't', '{', 'I'};
\r
89 const static EPS_UINT8 sbC20[] = {0x1, 0x2};
\r
91 const static EPS_INT8 sbSCRI[] = "scrI";
\r
92 const static EPS_INT8 sbCRI[] = "\x1D%d;%dcr{I";
\r
93 const static EPS_INT8 sbCUI[] = "cu{I";
\r
94 const static EPS_UINT8 sbECRI[] = {0x1D, 'e', 'c', 'r', 'I'};
\r
96 const static EPS_INT8 sbplrBE[] = "\x1D%d;0;2;256;256plr{E";
\r
98 /*----------------------------- Local Macro Definitions -------------------------------*/
\r
99 /*******************************************|********************************************/
\r
100 #define EPS_PAGE_RASTER (64) /* number of scanning rasters */
\r
101 #define EPS_PAGE_CMDBUFF_SIZE EPS_EJL_LINEMAX
\r
104 /*--------------------------- Data Structure Declarations ---------------------------*/
\r
105 /*******************************************|********************************************/
\r
106 typedef struct _tagEPS_PAGE_BAND_
\r
108 EPS_INT32 compressType; /* compless mode */
\r
109 EPS_INT32 widthInPixels;
\r
110 EPS_INT32 currentWidthInPixels;
\r
111 EPS_INT32 rasterRow;
\r
112 EPS_INT32 encDataSize; /* Compless data size */
\r
113 EPS_UINT8 *pEncData; /* Compless data */
\r
114 EPS_INT32 scanLineSize; /* Source data line size */
\r
115 EPS_INT32 scanBuffSize; /* Source data buffer size */
\r
116 EPS_INT32 scanDataSize; /* Source data size */
\r
117 EPS_UINT8 *pScanData; /* Source data */
\r
122 /*---------------------------- ESC/P-R Lib Global Variables --------------------------*/
\r
123 /*******************************************|********************************************/
\r
124 extern EPS_CMN_FUNC epsCmnFnc;
\r
125 extern EPS_PRINT_JOB printJob;
\r
127 /*---------------------------------- Local Variables --------------------------------*/
\r
128 /*******************************************|********************************************/
\r
129 static EPS_PAGE_BAND band;
\r
130 static EPS_COMMAND_BUFFER cmdBuf;
\r
131 static EPS_INT32 pageCount = 0;
\r
132 static EPS_INT32 emitRowCount = 0;
\r
135 /*-------------------------- Local Functions Declaration ----------------------------*/
\r
136 /*******************************************|********************************************/
\r
137 static EPS_ERR_CODE CmdBuffInit (EPS_COMMAND_BUFFER *pCmdBuff, EPS_PAGE_BAND *pBand);
\r
138 static EPS_ERR_CODE CmdBuffGrow (EPS_COMMAND_BUFFER *pCmdBuff, EPS_INT32 addSize);
\r
139 static void CmdBuffTerm (EPS_COMMAND_BUFFER *pCmdBuff);
\r
141 static EPS_ERR_CODE RegisterPalette (EPS_UINT16, EPS_UINT8*, EPS_COMMAND_BUFFER *pCmdBuff);
\r
143 static EPS_BOOL BandInit (EPS_PAGE_BAND* pBand);
\r
144 static void BandTerm (EPS_PAGE_BAND* pBand);
\r
145 static EPS_BOOL BandEmit (EPS_PAGE_BAND* pBand);
\r
146 static EPS_ERR_CODE BandSetScanData (EPS_PAGE_BAND* pBand, const EPS_UINT8 *Row, EPS_UINT32 DeltaByte);
\r
147 static EPS_ERR_CODE BandCompress (EPS_PAGE_BAND* pBand, EPS_INT32);
\r
148 static void BandClear (EPS_PAGE_BAND* pBand);
\r
150 static EPS_INT32 GetEncodeMode(EPS_INT32 bpp);
\r
152 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
153 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
154 /*%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%*/
\r
155 /*-------------------- Public Functions ---------------------*/
\r
156 /*%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%*/
\r
157 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
158 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
160 /*******************************************|********************************************/
\r
162 /* Function name: pageAllocBuffer_C() */
\r
166 /* Name: Type: Description: */
\r
169 /* Return value: */
\r
170 /* EPS_ERR_NONE - Success */
\r
171 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
174 /* Allocate buffer for ESC/Page Job. */
\r
176 /*******************************************|********************************************/
\r
177 EPS_ERR_CODE pageAllocBuffer_C(void)
\r
179 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
183 ret = BandInit(&band);
\r
185 if ( EPS_ERR_NONE == ret ) {
\r
186 ret = CmdBuffInit(&cmdBuf, &band);
\r
193 /*******************************************|********************************************/
\r
195 /* Function name: pageRelaseBuffer_C() */
\r
199 /* Name: Type: Description: */
\r
202 /* Return value: */
\r
206 /* Free buffer for ESC/Page Job. */
\r
208 /*******************************************|********************************************/
\r
209 void pageRelaseBuffer_C(void)
\r
211 /*** Clear Memory */
\r
212 CmdBuffTerm(&cmdBuf);
\r
217 /*******************************************|********************************************/
\r
219 /* Function name: pageStartJob_C() */
\r
223 /* Name: Type: Description: */
\r
226 /* Return value: */
\r
227 /* EPS_ERR_NONE - Success */
\r
228 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
229 /* EPS_ERR_OPR_FAIL - Internal Error */
\r
230 /* EPS_ERR_COMM_ERROR - Communication Error */
\r
231 /* EPS_ERR_PRINTER_ERR_OCCUR - Printer Error happened */
\r
234 /* Send ESC/Page start job commands. */
\r
236 /*******************************************|********************************************/
\r
237 EPS_ERR_CODE pageStartJob_C(void)
\r
239 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
240 EPS_UINT32 retBufSize = 0;
\r
244 #define pgStartJob_ADDCMD(CMD) { \
\r
245 ret = CmdBuffGrow(&cmdBuf, sizeof(CMD) ); \
\r
246 if( EPS_ERR_NONE != ret){EPS_RETURN( ret )} \
\r
247 memcpy(cmdBuf.p + cmdBuf.len, CMD, sizeof(CMD)); \
\r
248 cmdBuf.len += sizeof(CMD); \
\r
251 cmdBuf.len = 0; /* reset */
\r
253 /*** Make EJL Command ***/
\r
254 ret = ejlStart(&cmdBuf, CmdBuffGrow);
\r
255 if( EPS_ERR_NONE != ret){
\r
259 /* Initialize the printer. */
\r
260 pgStartJob_ADDCMD(sbIP)
\r
262 /* Set the minimum Unit Setting (600 or 300 resolution) */
\r
263 /* Dot Pattern Resolution Selection */
\r
264 if( EPS_IR_600X600 == printJob.attr.inputResolution) {
\r
265 pgStartJob_ADDCMD(sbSU600);
\r
266 pgStartJob_ADDCMD(sbSDS600_3);
\r
267 pgStartJob_ADDCMD(sbSDS600_2);
\r
268 pgStartJob_ADDCMD(sbSDS600_1);
\r
269 pgStartJob_ADDCMD(sbSDS600_0);
\r
270 } else if(EPS_IR_300X300 == printJob.attr.inputResolution) {
\r
271 pgStartJob_ADDCMD(sbSU300);
\r
272 pgStartJob_ADDCMD(sbSDS300_3);
\r
273 pgStartJob_ADDCMD(sbSDS300_2);
\r
274 pgStartJob_ADDCMD(sbSDS300_1);
\r
275 pgStartJob_ADDCMD(sbSDS300_0);
\r
278 pgStartJob_ADDCMD(sbSU150);
\r
279 pgStartJob_ADDCMD(sbSDS150_3);
\r
280 pgStartJob_ADDCMD(sbSDS150_2);
\r
281 pgStartJob_ADDCMD(sbSDS150_1);
\r
282 pgStartJob_ADDCMD(sbSDS150_0);
\r
285 /* Set Memory Mode Selection to Page memory mode */
\r
286 pgStartJob_ADDCMD(sbMMS);
\r
288 /* Set Paper Size */
\r
289 switch ( printJob.attr.mediaSizeIdx ) {
\r
290 case EPS_MSID_A4: pgStartJob_ADDCMD(sbPSSA4); break;
\r
291 case EPS_MSID_B5: pgStartJob_ADDCMD(sbPSSB5); break;
\r
292 case EPS_MSID_B4: pgStartJob_ADDCMD(sbPSSB4); break;
\r
293 case EPS_MSID_A3: pgStartJob_ADDCMD(sbPSSA3); break;
\r
294 case EPS_MSID_LETTER: pgStartJob_ADDCMD(sbPSSL); break;
\r
295 case EPS_MSID_LEGAL: pgStartJob_ADDCMD(sbPSSLE); break;
\r
296 case EPS_MSID_POSTCARD: pgStartJob_ADDCMD(sbPSSPS); break;
\r
297 default: pgStartJob_ADDCMD(sbPSSA4); break;
\r
300 ret = ejlPageEsc(&cmdBuf, CmdBuffGrow);
\r
301 if( EPS_ERR_NONE != ret){
\r
305 /* Set Clip Mode */
\r
306 pgStartJob_ADDCMD(sbCMS);
\r
308 /* Does not perform automatic carriage return line feed */
\r
309 pgStartJob_ADDCMD(sbACRLFS);
\r
311 /* Does not perform automatic Form Feed */
\r
312 pgStartJob_ADDCMD(sbAFFS);
\r
314 /* Set current position to 0 after Bit image draw */
\r
315 pgStartJob_ADDCMD(sbABPS);
\r
317 /* Step 4 - Adjust Vertical Print Position (if necessary) */
\r
319 pgStartJob_ADDCMD(sbCR);
\r
321 /* Set Absolute graph coordinate mode */
\r
322 pgStartJob_ADDCMD(sbSARGAS);
\r
324 /* Set current position move mode to print pitch */
\r
325 pgStartJob_ADDCMD(sbPMPPS);
\r
327 /* select paper type */
\r
328 if(printJob.attr.mediaTypeIdx == EPS_MTID_PLAIN){
\r
329 pgStartJob_ADDCMD(sbPTE1);
\r
331 pgStartJob_ADDCMD(sbPTE0);
\r
334 /* Set paper direction */
\r
335 pgStartJob_ADDCMD(sbPDS);
\r
337 /* Select Imaging device */
\r
338 pgStartJob_ADDCMD(sbPDDO);
\r
340 /* Select color space */
\r
341 pgStartJob_ADDCMD(sbCSE);
\r
343 /* cancel color controle */
\r
344 pgStartJob_ADDCMD(sbCMME_0);
\r
346 /* Select color collect */
\r
347 pgStartJob_ADDCMD(sbCCME);
\r
349 /* Select color condition */
\r
350 pgStartJob_ADDCMD(sbCAME);
\r
352 /* Select screening */
\r
353 pgStartJob_ADDCMD(sbRAE_1);
\r
354 pgStartJob_ADDCMD(sbRAE_2);
\r
355 pgStartJob_ADDCMD(sbRAE_3);
\r
357 /* set color controle */
\r
358 pgStartJob_ADDCMD(sbCMME_1);
\r
360 pgStartJob_ADDCMD(sbCLFP);
\r
362 /* set logical operation */
\r
363 pgStartJob_ADDCMD(sbWFE);
\r
365 switch( band.compressType )
\r
367 case EP_COMPRESS20:
\r
368 pgStartJob_ADDCMD(sbBCTI20); /* set compless table */
\r
369 pgStartJob_ADDCMD(sbC20); /* set data format */
\r
371 default:/* for 8bpp */
\r
374 ret = SendCommand((EPS_UINT8*)cmdBuf.p, cmdBuf.len, &retBufSize, TRUE);
\r
382 /*******************************************|********************************************/
\r
384 /* Function name: pageEndJob_C() */
\r
388 /* Name: Type: Description: */
\r
391 /* Return value: */
\r
392 /* EPS_ERR_NONE - Success */
\r
393 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
394 /* EPS_ERR_OPR_FAIL - Internal Error */
\r
395 /* EPS_ERR_COMM_ERROR - Communication Error */
\r
396 /* EPS_ERR_PRINTER_ERR_OCCUR - Printer Error happened */
\r
399 /* Send ESC/Page end job commands. */
\r
401 /*******************************************|********************************************/
\r
402 EPS_ERR_CODE pageEndJob_C()
\r
404 EPS_ERR_CODE ret = EPS_ERR_NONE; /* Return status of internal calls */
\r
405 EPS_UINT32 retBufSize = 0;
\r
409 cmdBuf.len = 0; /* reset */
\r
411 /* end color image drawing */
\r
412 memcpy((EPS_INT8*)cmdBuf.p, sbECRI, sizeof(sbECRI));
\r
413 cmdBuf.len += sizeof(sbECRI);
\r
415 /*** Make EJL Command ***/
\r
416 ret = ejlEnd(&cmdBuf, CmdBuffGrow, pageCount);
\r
417 if( EPS_ERR_NONE != ret){
\r
421 ret = SendCommand((EPS_UINT8*)cmdBuf.p, cmdBuf.len, &retBufSize, TRUE);
\r
427 /*******************************************|********************************************/
\r
429 /* Function name: pageStartPage_C() */
\r
433 /* Name: Type: Description: */
\r
436 /* Return value: */
\r
437 /* EPS_ERR_NONE - Success */
\r
438 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
439 /* EPS_ERR_OPR_FAIL - Internal Error */
\r
440 /* EPS_ERR_COMM_ERROR - Communication Error */
\r
441 /* EPS_ERR_PRINTER_ERR_OCCUR - Printer Error happened */
\r
444 /* Send ESC/Page start page commands. */
\r
446 /*******************************************|********************************************/
\r
447 EPS_ERR_CODE pageStartPage_C()
\r
449 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
450 EPS_UINT32 retBufSize = 0;
\r
454 cmdBuf.len = 0; /* reset */
\r
455 if( 0 == pageCount ){
\r
456 if (printJob.attr.colorPlane == EPS_CP_256COLOR){
\r
457 ret = RegisterPalette(printJob.attr.paletteSize, printJob.attr.paletteData,
\r
461 memcpy(cmdBuf.p, sbFF, sizeof(sbFF));
\r
462 cmdBuf.len += sizeof(sbFF);
\r
464 ret = ejlPageEsc(&cmdBuf, CmdBuffGrow);
\r
466 if( EPS_ERR_NONE != ret){
\r
470 if(cmdBuf.len > 0){
\r
471 ret = SendCommand((EPS_UINT8*)cmdBuf.p, cmdBuf.len, &retBufSize, TRUE);
\r
481 /*******************************************|********************************************/
\r
483 /* Function name: pageEndPage_C() */
\r
487 /* Name: Type: Description: */
\r
490 /* Return value: */
\r
491 /* EPS_ERR_NONE - Success */
\r
492 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
493 /* EPS_ERR_OPR_FAIL - Internal Error */
\r
494 /* EPS_ERR_COMM_ERROR - Communication Error */
\r
495 /* EPS_ERR_PRINTER_ERR_OCCUR - Printer Error happened */
\r
498 /* Send ESC/Page end page commands. */
\r
500 /*******************************************|********************************************/
\r
501 EPS_ERR_CODE pageEndPage_C()
\r
503 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
507 if( EP_COMPRESS0 != band.compressType ){
\r
508 BandCompress(&band, printJob.bpp*8);
\r
509 if( band.encDataSize > 0 ) {
\r
510 ret = BandEmit(&band);
\r
513 if( band.scanDataSize > 0 ){
\r
514 ret = BandEmit(&band);
\r
518 if( EPS_ERR_NONE == ret){
\r
526 /*******************************************|********************************************/
\r
528 /* Function name: pageColorRow_C() */
\r
532 /* Name: Type: Description: */
\r
535 /* Return value: */
\r
536 /* EPS_ERR_NONE - Success */
\r
537 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
538 /* EPS_ERR_OPR_FAIL - Internal Error */
\r
539 /* EPS_ERR_COMM_ERROR - Communication Error */
\r
540 /* EPS_ERR_PRINTER_ERR_OCCUR - Printer Error happened */
\r
543 /* Send ESC/Page raster commands. */
\r
545 /*******************************************|********************************************/
\r
546 EPS_ERR_CODE pageColorRow_C(
\r
548 const EPS_BANDBMP* pInBmp,
\r
552 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
553 EPS_UINT16 linePixelSize;
\r
554 EPS_UINT16 widthBytes;
\r
558 if( (EPS_UINT32)(pBandRec->right - pBandRec->left) <= printJob.printableAreaWidth){
\r
559 linePixelSize = (EPS_UINT16)(pBandRec->right - pBandRec->left);
\r
561 linePixelSize = (EPS_UINT16) printJob.printableAreaWidth;
\r
563 widthBytes = linePixelSize * printJob.bpp;
\r
564 band.currentWidthInPixels = linePixelSize;
\r
565 /* reset scan size from current line size */
\r
566 band.scanLineSize = widthBytes;
\r
567 if( band.scanLineSize & 3 ){
\r
569 band.scanLineSize = (band.scanLineSize & ~3) + 4;
\r
572 BandSetScanData(&band, pInBmp->bits, widthBytes);
\r
574 if(EP_COMPRESS0 != band.compressType){
\r
575 if( (band.rasterRow >= EPS_PAGE_RASTER )) {
\r
576 BandCompress(&band, printJob.bpp*8);
\r
577 if( band.encDataSize > 0 ) {
\r
578 ret = BandEmit(&band);
\r
581 emitRowCount += band.rasterRow;
\r
582 if( EPS_ERR_NONE == ret){
\r
583 BandClear(&band); /* reset */
\r
587 ret = BandEmit(&band);
\r
588 emitRowCount += band.rasterRow;
\r
589 if( EPS_ERR_NONE == ret){
\r
590 BandClear(&band); /* reset */
\r
598 /*******************************************|********************************************/
\r
600 /* Function name: pageSendLeftovers_C() */
\r
604 /* Name: Type: Description: */
\r
607 /* Return value: */
\r
608 /* EPS_ERR_NONE - Success */
\r
609 /* EPS_ERR_INVALID_CALL - This call was unnecessary */
\r
610 /* EPS_ERR_OPR_FAIL - Internal Error */
\r
611 /* EPS_ERR_COMM_ERROR - Communication Error */
\r
612 /* EPS_ERR_PRINTER_ERR_OCCUR - Printer Error happened */
\r
615 /* send leftovers data. */
\r
617 /*******************************************|********************************************/
\r
618 EPS_ERR_CODE pageSendLeftovers_C(
\r
623 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
624 EPS_UINT32 retBufSize = 0;
\r
628 if( NULL != printJob.contData.sendData && 0 < printJob.contData.sendDataSize){
\r
630 ret = SendCommand(printJob.contData.sendData,
\r
631 printJob.contData.sendDataSize, &retBufSize, TRUE);
\r
633 if( EPS_ERR_NONE == ret ){
\r
634 if( band.dataSent ){
\r
635 /* send encode data */
\r
636 if( EP_COMPRESS0 != band.compressType ){
\r
637 ret = SendCommand(band.pEncData, band.encDataSize, &retBufSize, TRUE);
\r
639 ret = SendCommand(band.pScanData, band.scanDataSize, &retBufSize, TRUE);
\r
642 band.dataSent = FALSE;
\r
644 if( EPS_ERR_NONE == ret){
\r
649 ret = EPS_ERR_INVALID_CALL;
\r
655 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
656 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
657 /*%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%*/
\r
658 /*-------------------- Local Functions ---------------------*/
\r
659 /*%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%*/
\r
660 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
661 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
664 /*******************************************|********************************************/
\r
666 /* Function name: CmdBuffInit() */
\r
670 /* Name: Type: Description: */
\r
671 /* pCmdBuff EPS_COMMAND_BUFFER* I: command buffer strcture */
\r
672 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
674 /* Return value: */
\r
675 /* EPS_ERR_NONE - Success */
\r
676 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
679 /* Allocate command buffer. */
\r
681 /*******************************************|********************************************/
\r
682 static EPS_ERR_CODE CmdBuffInit(
\r
684 EPS_COMMAND_BUFFER* pCmdBuff,
\r
685 EPS_PAGE_BAND* pBand
\r
688 pCmdBuff->pExtent = pBand;
\r
690 if(EP_COMPRESS0 == pBand->compressType){
\r
691 pCmdBuff->size = EPS_EJL_LINEMAX;
\r
692 pCmdBuff->p = EPS_ALLOC(pCmdBuff->size);
\r
693 if( NULL == pCmdBuff->p){
\r
694 return EPS_ERR_MEMORY_ALLOCATION;
\r
698 /* use scan-buffer as command-buffer */
\r
699 pCmdBuff->size = pBand->scanBuffSize;
\r
700 pCmdBuff->p = (EPS_INT8*)pBand->pScanData;
\r
705 return EPS_ERR_NONE;
\r
709 /*******************************************|********************************************/
\r
711 /* Function name: CmdBuffGrow() */
\r
715 /* Name: Type: Description: */
\r
716 /* pCmdBuff EPS_COMMAND_BUFFER* I: command buffer strcture */
\r
717 /* addSize EPS_INT32 I: growing size */
\r
719 /* Return value: */
\r
720 /* EPS_ERR_NONE - Success */
\r
721 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
724 /* ReAllocate command buffer. */
\r
726 /*******************************************|********************************************/
\r
727 static EPS_ERR_CODE CmdBuffGrow(
\r
729 EPS_COMMAND_BUFFER* pCmdBuff,
\r
733 EPS_INT32 block, sizeNew;
\r
734 EPS_PAGE_BAND *pBand = (EPS_PAGE_BAND*)pCmdBuff->pExtent;
\r
736 if(pCmdBuff->size < pCmdBuff->len + addSize){
\r
737 block = (((pCmdBuff->len+addSize) / EPS_PAGE_CMDBUFF_SIZE) + 1);
\r
738 sizeNew = block * EPS_PAGE_CMDBUFF_SIZE;
\r
739 pCmdBuff->p = memRealloc(pCmdBuff->p, pCmdBuff->size, sizeNew);
\r
740 if( NULL == pCmdBuff->p){
\r
741 return EPS_ERR_MEMORY_ALLOCATION;
\r
743 pCmdBuff->size = sizeNew;
\r
745 if(EP_COMPRESS0 != pBand->compressType){
\r
746 pBand->scanBuffSize = cmdBuf.size;
\r
747 pBand->pScanData = (EPS_UINT8*)cmdBuf.p;
\r
751 return EPS_ERR_NONE;
\r
755 /*******************************************|********************************************/
\r
757 /* Function name: CmdBuffTerm() */
\r
761 /* Name: Type: Description: */
\r
762 /* pCmdBuff EPS_COMMAND_BUFFER* I: command buffer strcture */
\r
764 /* Return value: */
\r
768 /* Free command buffer. */
\r
770 /*******************************************|********************************************/
\r
771 static void CmdBuffTerm (
\r
773 EPS_COMMAND_BUFFER* pCmdBuff
\r
776 EPS_PAGE_BAND* pBand = (EPS_PAGE_BAND*)pCmdBuff->pExtent;
\r
778 if( NULL != pBand ){
\r
779 if(EP_COMPRESS0 == pBand->compressType){
\r
780 EPS_SAFE_RELEASE(pCmdBuff->p);
\r
782 pCmdBuff->p = NULL;
\r
787 pCmdBuff->size = 0;
\r
788 pCmdBuff->pExtent = NULL;
\r
792 /*******************************************|********************************************/
\r
794 /* Function name: RegisterPalette() */
\r
798 /* Name: Type: Description: */
\r
799 /* paletteSize EPS_UINT16 I: Palette Size */
\r
800 /* paletteData EPS_UINT8* I: Palette Size */
\r
801 /* pCmdBuff EPS_COMMAND_BUFFER* I: command buffer strcture */
\r
803 /* Return value: */
\r
804 /* EPS_ERR_NONE - Success */
\r
805 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
808 /* Register the palette for Printer. */
\r
810 /*******************************************|********************************************/
\r
811 static EPS_ERR_CODE RegisterPalette(
\r
813 EPS_UINT16 paletteSize,
\r
814 EPS_UINT8* paletteData,
\r
815 EPS_COMMAND_BUFFER* pCmdBuff
\r
818 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
819 EPS_INT8 *p = NULL;
\r
820 EPS_UINT16 entryNum = paletteSize / 3; /* 3 = RGB */
\r
825 #ifdef GCOMSW_DEBUG
\r
826 if(pCmdBuff->len+EPS_EJL_LINEMAX > pCmdBuff->size){EPS_DBGPRINT(("Command buffer not enough!\r\n"))}
\r
828 p = pCmdBuff->p + pCmdBuff->len;
\r
830 sprintf(p, sbplrBE, entryNum*4); /* 4 = RGBA */
\r
831 pCmdBuff->len += (EPS_UINT32)strlen(p);
\r
833 /* expand for palette data */
\r
834 ret = CmdBuffGrow(pCmdBuff, entryNum*4);
\r
835 if( EPS_ERR_NONE != ret){
\r
838 p = pCmdBuff->p + pCmdBuff->len;
\r
841 for(i = 0; i < paletteSize; i+=3){
\r
842 *p++ = paletteData[i+2]; /* B */
\r
843 *p++ = paletteData[i+1]; /* G */
\r
844 *p++ = paletteData[i]; /* R */
\r
845 *p++ = 0; /* dummy */
\r
847 pCmdBuff->len = (EPS_INT32)(p - pCmdBuff->p);
\r
853 /*******************************************|********************************************/
\r
855 /* Function name: BandInit() */
\r
859 /* Name: Type: Description: */
\r
860 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
862 /* Return value: */
\r
863 /* EPS_ERR_NONE - Success */
\r
864 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
867 /* Allocate band data buffers. */
\r
869 /*******************************************|********************************************/
\r
870 EPS_ERR_CODE BandInit(
\r
872 EPS_PAGE_BAND* pBand
\r
875 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
879 memset(pBand, 0, sizeof(EPS_PAGE_BAND));
\r
880 pBand->compressType = GetEncodeMode( printJob.attr.colorPlane ); /* Set compless mode */
\r
881 pBand->widthInPixels = printJob.printableAreaWidth;
\r
882 pBand->scanDataSize = 0;
\r
883 pBand->encDataSize = 0;
\r
884 pBand->emited = FALSE;
\r
885 pBand->dataSent = FALSE;
\r
887 if(EP_COMPRESS0 == pBand->compressType){
\r
888 pBand->scanLineSize = pBand->widthInPixels * printJob.bpp;
\r
889 pBand->scanBuffSize = pBand->scanLineSize; /* one line buffering */
\r
891 pBand->scanLineSize = (pBand->widthInPixels * printJob.bpp);
\r
892 if( pBand->scanLineSize & 3 ){
\r
894 pBand->scanLineSize = (pBand->scanLineSize & ~3) + 4;
\r
896 pBand->scanBuffSize = pBand->scanLineSize * EPS_PAGE_RASTER;
\r
898 pBand->pScanData = (EPS_UINT8*)EPS_ALLOC( pBand->scanBuffSize );
\r
899 if( NULL == pBand->pScanData ){
\r
900 EPS_RETURN( EPS_ERR_MEMORY_ALLOCATION )
\r
907 /*******************************************|********************************************/
\r
909 /* Function name: BandTerm() */
\r
913 /* Name: Type: Description: */
\r
914 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
916 /* Return value: */
\r
920 /* free band data buffers. */
\r
922 /*******************************************|********************************************/
\r
923 static void BandTerm(
\r
925 EPS_PAGE_BAND* pBand
\r
930 EPS_SAFE_RELEASE(pBand->pScanData);
\r
937 /*******************************************|********************************************/
\r
939 /* Function name: BandEmit() */
\r
943 /* Name: Type: Description: */
\r
944 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
946 /* Return value: */
\r
947 /* EPS_ERR_NONE - Success */
\r
948 /* EPS_ERR_MEMORY_ALLOCATION - Fail to memory allocation */
\r
949 /* EPS_ERR_OPR_FAIL - Internal Error */
\r
950 /* EPS_ERR_COMM_ERROR - Communication Error */
\r
951 /* EPS_ERR_PRINTER_ERR_OCCUR - Printer Error happened */
\r
954 /* Emit data to printer. */
\r
956 /*******************************************|********************************************/
\r
957 static EPS_ERR_CODE BandEmit(
\r
959 EPS_PAGE_BAND* pBand
\r
962 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
963 EPS_INT8 *p = NULL;
\r
964 EPS_UINT32 retBufSize = 0;
\r
968 cmdBuf.len = 0; /* reset */
\r
969 p = (EPS_INT8*)cmdBuf.p;
\r
971 if( pBand->emited ){
\r
972 /* end color image drawing for previous data */
\r
973 memcpy(p, sbECRI, sizeof(sbECRI));
\r
974 p += sizeof(sbECRI);
\r
976 pBand->emited = TRUE;
\r
979 /* Reset the current absolute position */
\r
980 strcpy(p, "\x1D""0X");
\r
983 EPS_DBGPRINT(("Emit Y pos = %d \r\n", emitRowCount));
\r
984 sprintf(p, "\x1D%dY", emitRowCount);
\r
987 /* ----- stretch color image ----- */
\r
988 if(printJob.attr.colorPlane == EPS_CP_256COLOR){
\r
989 strcpy(p, "\x1D""2;204;0;"); /* Indirectly RGB8, palett=0 */
\r
991 strcpy(p, "\x1D""2;102;0;"); /* RGB888 */
\r
995 switch(pBand->compressType){
\r
996 case EP_COMPRESS20:
\r
1006 sprintf(p, "%d;%d;%d;%d;0%s", pBand->currentWidthInPixels, pBand->rasterRow,
\r
1007 pBand->currentWidthInPixels, pBand->rasterRow, sbSCRI);
\r
1010 /*** Draw color image ***/
\r
1011 if(EP_COMPRESS20 == pBand->compressType){
\r
1012 /* Number of data bytes */
\r
1013 /* Bit image width */
\r
1014 sprintf(p, sbCRI, pBand->encDataSize, pBand->rasterRow);
\r
1016 ret = SendCommand((EPS_UINT8*)cmdBuf.p, (EPS_INT32)(p - (EPS_INT8*)cmdBuf.p), &retBufSize, TRUE);
\r
1018 pBand->dataSent = TRUE; /* encode date until send */
\r
1019 if( EPS_ERR_NONE == ret){
\r
1020 ret = SendCommand(pBand->pEncData, pBand->encDataSize, &retBufSize, TRUE);
\r
1021 pBand->dataSent = FALSE; /* encode date has sent */
\r
1024 } else{ /* non compless */
\r
1025 /* Number of data bytes */
\r
1026 /* Bit image width */
\r
1027 sprintf(p, "\x1D""%d;%d%s", pBand->scanDataSize, pBand->rasterRow, sbCUI);
\r
1030 ret = SendCommand((EPS_UINT8*)cmdBuf.p, (EPS_INT32)(p - (EPS_INT8*)cmdBuf.p), &retBufSize, TRUE);
\r
1032 pBand->dataSent = TRUE; /* encode date until send */
\r
1033 if( EPS_ERR_NONE == ret){
\r
1034 ret = SendCommand(pBand->pScanData, pBand->scanDataSize, &retBufSize, TRUE);
\r
1035 pBand->dataSent = FALSE; /* encode date has sent */
\r
1043 /*******************************************|********************************************/
\r
1045 /* Function name: BandSetScanData() */
\r
1049 /* Name: Type: Description: */
\r
1050 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
1051 /* Row const EPS_UINT8* I: band data */
\r
1052 /* DeltaByte EPS_UINT32 I: number of data bytes */
\r
1054 /* Return value: */
\r
1055 /* EPS_ERR_NONE - Success */
\r
1057 /* Description: */
\r
1058 /* save band data. */
\r
1060 /*******************************************|********************************************/
\r
1061 static EPS_ERR_CODE BandSetScanData(
\r
1063 EPS_PAGE_BAND* pBand,
\r
1064 const EPS_UINT8* Row,
\r
1065 EPS_UINT32 DeltaByte
\r
1068 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
1072 pBand->rasterRow++;
\r
1074 if(EP_COMPRESS0 != pBand->compressType){
\r
1075 memcpy(pBand->pScanData + (pBand->scanLineSize * (EPS_PAGE_RASTER - pBand->rasterRow)), Row, DeltaByte);
\r
1077 memcpy(pBand->pScanData, Row, DeltaByte);
\r
1079 pBand->scanDataSize += DeltaByte;
\r
1085 /*******************************************|********************************************/
\r
1087 /* Function name: BandCompress() */
\r
1091 /* Name: Type: Description: */
\r
1092 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
1093 /* WidthBytes EPS_INT32 I: data length */
\r
1094 /* bitCount EPS_INT32 I: image bit count */
\r
1096 /* Return value: */
\r
1097 /* EPS_ERR_NONE - Success */
\r
1099 /* Description: */
\r
1100 /* Data is compressed. */
\r
1102 /*******************************************|********************************************/
\r
1103 static EPS_ERR_CODE BandCompress(
\r
1105 EPS_PAGE_BAND* pBand,
\r
1106 EPS_INT32 bitCount
\r
1109 EPS_ERR_CODE ret = EPS_ERR_NONE;
\r
1110 EPS_BITMAPINFO BitMapInfo;
\r
1111 EPS_UINT32 lCompressType;
\r
1112 EPS_UINT32 lImageSize = 0;
\r
1114 EPS_UINT8* pRealBits;
\r
1118 memset(&BitMapInfo, 0, sizeof(EPS_BITMAPINFO));
\r
1120 BitMapInfo.biWidth = pBand->currentWidthInPixels;
\r
1121 BitMapInfo.biHeight = pBand->rasterRow;
\r
1122 BitMapInfo.biBitCount = bitCount;
\r
1124 rect.left = rect.top = 0;
\r
1125 rect.bottom = pBand->rasterRow;
\r
1126 rect.right = pBand->currentWidthInPixels;
\r
1128 pRealBits = pBand->pScanData + (pBand->scanLineSize * (EPS_PAGE_RASTER - pBand->rasterRow));
\r
1130 pBand->pEncData = CompressBitImage(
\r
1134 pBand->compressType,
\r
1138 pBand->encDataSize = lImageSize;
\r
1144 /*******************************************|********************************************/
\r
1146 /* Function name: BandClear() */
\r
1150 /* Name: Type: Description: */
\r
1151 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
1153 /* Return value: */
\r
1154 /* EPS_ERR_NONE - Success */
\r
1156 /* Description: */
\r
1157 /* Reset band data. */
\r
1159 /*******************************************|********************************************/
\r
1160 static void BandClear(
\r
1162 EPS_PAGE_BAND *pBand
\r
1166 EPS_SAFE_RELEASE(pBand->pEncData);
\r
1167 pBand->scanDataSize = 0;
\r
1168 pBand->encDataSize = 0;
\r
1169 pBand->rasterRow = 0;
\r
1175 /*******************************************|********************************************/
\r
1177 /* Function name: GetEncodeMode() */
\r
1181 /* Name: Type: Description: */
\r
1182 /* pBand EPS_PAGE_BAND* I: band data strcture */
\r
1184 /* Return value: */
\r
1185 /* EPS_ERR_NONE compless mode */
\r
1187 /* Description: */
\r
1188 /* choose compless mode. */
\r
1190 /*******************************************|********************************************/
\r
1191 static EPS_INT32 GetEncodeMode(
\r
1196 if(bpp == EPS_CP_256COLOR){
\r
1197 return EP_COMPRESS0;
\r
1198 } else{ /* if EPS_CP_FULLCOLOR */
\r
1199 return EP_COMPRESS20;
\r
1203 /*______________________________ epson-escpage-color.c ______________________________*/
\r
1205 /*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
\r
1206 /* 1 2 3 4 5 6 7 8 */
\r
1207 /*******************************************|********************************************/
\r
1208 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
1209 /***** End of File *** End of File *** End of File *** End of File *** End of File ******/
\r
1210 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r