Experimental new raster

Try to output raster using modern graphinc functions  'GS ( L'. Epson
says it is indended for whole future, and that old 'GS v' will not be
supported. However experiment shows that for cheap zijiang zj-58 it
doesn't work.

To try, set RASTER_TYPE=New when configuring
(i.e. cmake ... -DRASTER_TYPE=New)
master
klirichek 6 years ago
parent 36b5458d75
commit 5a6739f158

@ -34,6 +34,13 @@ if ( CMAKE_BUILD_TYPE STREQUAL "Debug" )
endif ()
endif ()
# experimental rastering
SET ( RASTER_TYPE Old CACHE STRING "Flavor how to output the raster images" )
set_property ( CACHE RASTER_TYPE PROPERTY STRINGS "Old" "New" )
if ( RASTER_TYPE STREQUAL "New" )
target_compile_definitions ( rastertozj PRIVATE NEWRASTER )
endif()
# build ppds
if ( NOT DEFINED PPDC )
find_program ( PPDC ppdc )

@ -340,10 +340,37 @@ static inline void send_raster(const unsigned char *pBuf, int width8,
int height) {
if (!height)
return;
DEBUGPRINT("Raster block %dx%d pixels\n", width8*8, height);
DEBUGPRINT("Raster block %dx%d pixels\n", width8 * 8, height);
#ifdef NEWRASTER
// experimental - output raster according to new ESC/POS specification,
// using graphic function.
// It may work with kind of epson, but zijiang fails, oops...
// download raster - function 112
SendCommand("\x1d(L"); // GS ( L
mputnum(width8 * height + 10); // pL, pH
mputchar ('0'); // m=48
mputchar (112); // fn
mputchar ('0'); // monochrome digital
mputchar ('\1'); // bx
mputchar ('\1'); // by
mputchar ('1'); // с (color)= 1
mputnum(width8*8); // xL, xH
mputnum(height); // yL, yH
outputarray((char *)pBuf, width8 * height);
// print raster - function 50
SendCommand("\x1d(L");
mputnum (2); // pL, pH
mputchar (48); // m
mputchar (50); // function = 50
#else
sendRasterHeader(width8, height);
outputarray((char *)pBuf, width8 * height);
flushBuffer();
#endif
}
#define EXITPRINT(CODE) \

Loading…
Cancel
Save