From: Robert K. <rl...@al...> - 2020-09-05 15:44:01
|
On 9/5/20 8:31 AM, Sambhav Dusad wrote: > Hello, > > The driver port is almost complete. I wanted to know what to put in the setup and callback function > which fills the driver data and media data? Also, what should be the driver data format? > > Michael, can you make a repository for the Gutenprint Printer Application? I think I can make a PR > for the raster driver now. > Extremely sorry for the delay, was not able to give any time to this due to end semester exams. We really should move this discussion to gim...@li... (gimp-print was the original name for the project, which started with Mike's print plugin for GIMP and was later renamed to Gutenprint with the 5.0 release). For filling the driver data: Reference the stp_image_t structure defined in include/gutenprint/image.h. You need to write the appropriate functions here. You can see the CUPS driver implementation in src/cups/rastertogutenprint.c. Most of these are likely to be pretty simple. The hard one, of course, is Image_get_row(). This is called by the core via stp_image_get_row(). This one's going to pull a row of raster data off the queue and stick it in the provided data buffer, up to the number of bytes specified (so you don't overflow the buffer) and returns a status (either OK or abort -- that's how a print can be aborted). The raster format is either 8 or 16 byte (native ordering) K, W (inverse grayscale) RGB, CMY,CMYK, or KCMY. There's also a "raw" format, which allows specifying arbitrary channels (currently supported only for Epson printers, don't worry about that for now). As for filling in settings, your application does that and does the necessary stp_set_* functions to set up all the options. |