Some question about function StartPage() in Rastertohp.c

Michael Sweet mike at easysw.com
Wed Nov 16 18:20:49 PST 2005


Zhang xin wrote:
>> Yes, that should work.  CUPS will figure out the best filter(s) to
>> run in front of yours and then provide you with raster data as
>> defined in your PPD file.
> 
>> GDI or host-based printers are generally undocumented.  You may find
>> information on linuxprinting.org for specific models, however the
>> printer manufacturer is your best source of information (good luck!)
> 
> Sorry to reply you so lately,and in these days we try our best to find some resources about GDI printer,it's so hardly that we have make no progress on it:(but thanks for your help mostly.we will go on our trip,although there so many difficulties.
> 
> and we now have some questions on the code in Rastettohp.c from line 389 to line 406. in line 398:
>     BitBuffer = malloc(ColorBits * ((header->cupsWidth + 7) / 8));
> we wondered why ColorBits have relations weith cupsWidth ? what's the meaning of cupsWidth?

Please read the documentation, the CUPS book, and the header files...

cupsWidth is the width of the page image in pixels.

ColorBits is the number of bits per pixel for 1 colored dot - some
HP printers support different bit depths for color and black dots.
The bits are transferred separately, so for 2 bits per pixel you
send two 1-bit-per-pixel lines (MSB then LSB).

This code just allocates a buffer large enough to hold 1 line of
raster data composed of one or more 1 bit per pixel line buffers.

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com




More information about the cups mailing list