RE: UNIDRV Banding Line Count error? by bobbym
bobbym
Wed Oct 19 19:16:24 CDT 2005
------=_NextPart_0001_24F00593
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi JlC,
Unidrv is doing something similar to what you mentioned in the previous
message.
It checks (in the DrvNextBand) to make sure the band doesn't shoot over the
printable area and then adjusts the clipping to the bottom of the image
area in that scenario. Are you trying to implement NextBand on your own and
not calling back into unidrv's NextBand function?
Then you would have to do something similar.
Hope this helps.
Thank you,
Bobby Mattappally
Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Thread-Topic: UNIDRV Banding Line Count error?
thread-index: AcXU0uJsRaNqauvWR5iB5DCky2ogsQ==
X-WBNR-Posting-Host: 208.37.22.158
Sorry for the endless follow-ons:
We *did* have this issue before, on an experimental 8BPP-> 1BPP
ImageProcessing callback, and I had to compress/spool the data myself.
Less than 18 months ago, no less, and I'd posted to this group.
Time for a new pot of coffee....
------------------------------------------
The question at hand then, is:
If the bands are being set up as small working surfaces,
*how* is the mismatch of the sum-of-band size to page size handled in
UNIDRV?
In ImageProcessing, the bitmap for each band *is* accurately sized, to end
at the
end of the page.
The *surface*, however, in NextBand, is always the *same* size,
and that size is what is passed on to compression / spooling. This results
in garbage data in the output on the last band, since the bitmap area is
shorter.
Is it the *bitmap* height, or the *surface* height that is being passed
downstream for output by UNIDRV?
I'm not sure *what* I can do to control this behavior in a documented way--
any suggestions would be greatly appreciated.
Thanks again!
--
J.C.
"JLC" wrote:
> Um, that's DDK ** 3790 ** .
>
> --
> J.C.
>
>
> "JLC" wrote:
>
> > Bobby,
> > Many thanks for the reply:
> > I'm using DDK3700, xp env. We need to support Win2K SP3 and beyond.
> > I will take a look at the server 2003 example, as you suggest.
> >
> > This problem is a little surprising, since we've got ImageProcessing()
code
> > for 1BPP and 8BPP, that has no banding problems of this kind: this has
been
> > released for a few years. Maybe the 4 planes / 1BPP is a special case?
> >
> > One approach that has **almost** worked:
> > 1. In OEMEnablePDEV, save the page length in pixels to OEMPDEV.
> > 2. In OEMStartDoc, save the band length to OEMPDEV.
> > 3. In OEMNextBand, save the accumulated band lengths to OEMPDEV.
> > If the end of the current band will overshoot the saved page length,
> > change pso->sizelBitmap->cy to the size that will match the end of
page.
> > 4. In OEMStartPage, check the pso->sizelBitmap->cy against the saved
initial
> >
> > bandsize, and reset it if necessary.
> >
> > This has eliminated the extra garbage data, but I'm now 1 pixel short /
> > page....
> > Thanks again for the suggestions--
> > Joe C.
> > --
> > J.C.
> >
> >
> > "JLC" wrote:
> >
> > >
> > > --
> > > J.C.
> > >
> > >
> > > "Bobby Mattappally [MS]" wrote:
> > >
> > > >
> > > > J.C,
> > > > I am not aware of any bugs in the unidrv banding code.
> > > > It is very unlikely (we would have heard about it long back)
> > > > Can you make sure you have read and followed comments section in
the ddk
> > > > docs on "ImageProcessing
> > > > "?
> > > > Also look at the bitmap sample on server 2003 ddk to see an
implementation
> > > > of imageprocessing.
> > > >
> > > > Hope this helps.
> > > >
> > > > Thank you,
> > > > Bobby Mattappally
> > > > Microsoft
> > > >
> > > > This posting is provided "AS IS" with no warranties, and confers no
rights.
> > > >
> > > > --------------------
> > > > Thread-Topic: UNIDRV Banding Line Count error?
> > > >
> > > >
> > > > Hello,
> > > > I've got a rendering plugin with ImageProcessing doing RGB24 to CMYK
> > > > custom halftoning. (That is, DevNumPlanes = 4, DevBPP = 1, DrvBPP=
> > > > 24.) The conversion itself works fine, *except*:
> > > > when UNIDRV is doing banding, if the last band is shorter than
> > > > the previous bands, the difference (in lines) is added to the print
as
> > > > garbage raster data.
> > > > E.G: for a 3300 line Letter page:
> > > > ImageProcessing reports 4 x bands of 664 lines, then one of 644.
> > > > What is printed is the 3300 lines expected, plus (664 - 644 =)20
lines
> > > > of garbage.
> > > > For a 3750 line page:
> > > > ImageProcessing reports 4 x bands of 752 lines, then one of 742.
> > > > The expected 3750 lines print, plus 10 lines (752 - 742) of garbage.
> > > >
> > > > It *looks* like when Unidrv splits the page into bands, it's not
> > > > tracking the actual count when passing the bands to Output.
> > > >
> > > > Comments? Suggestions??
> > > > I'd rather not do the compression and output
> > > > to spooler myself, if there's a known fix for this issue.
> > > > Thanks! -- Joe C.
> > > >
> > > > --
> > > > J.C
------=_NextPart_0001_24F00593
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Hi JlC,
\par
\par Unidrv is doing something similar to what you mentioned in the previous message.
\par It checks (in the DrvNextBand) to make sure the band doesn't shoot over the printable area and then adjusts the clipping to the bottom of the image area in that scenario. Are you trying to implement NextBand on your own and not calling back into unidrv's NextBand function?
\par Then you would have to do something similar.
\par
\par
\par
\par Hope this helps.
\par
\par Thank you,
\par Bobby Mattappally
\par Microsoft
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par \pard\li720 --------------------
\par Thread-Topic: UNIDRV Banding Line Count error?
\par thread-index: AcXU0uJsRaNqauvWR5iB5DCky2ogsQ==
\par X-WBNR-Posting-Host: 208.37.22.158
\par
\par
\par Sorry for the endless follow-ons:
\par We *did* have this issue before, on an experimental 8BPP-> 1BPP
\par ImageProcessing callback, and I had to compress/spool the data myself.
\par Less than 18 months ago, no less, and I'd posted to this group.
\par Time for a new pot of coffee....
\par ------------------------------------------
\par The question at hand then, is:
\par
\par If the bands are being set up as small working surfaces,
\par *how* is the mismatch of the sum-of-band size to page size handled in UNIDRV?
\par In ImageProcessing, the bitmap for each band *is* accurately sized, to end
\par at the
\par end of the page.
\par The *surface*, however, in NextBand, is always the *same* size,
\par and that size is what is passed on to compression / spooling. This results
\par in garbage data in the output on the last band, since the bitmap area is
\par shorter.
\par
\par Is it the *bitmap* height, or the *surface* height that is being passed
\par downstream for output by UNIDRV?
\par
\par I'm not sure *what* I can do to control this behavior in a documented way--
\par any suggestions would be greatly appreciated.
\par
\par Thanks again!
\par
\par
\par --
\par J.C.
\par
\par
\par "JLC" wrote:
\par
\par > Um, that's DDK ** 3790 ** .
\par >
\par > --
\par > J.C.
\par >
\par >
\par > "JLC" wrote:
\par >
\par > > Bobby,
\par > > Many thanks for the reply:
\par > > I'm using DDK3700, xp env. We need to support Win2K SP3 and beyond.
\par > > I will take a look at the server 2003 example, as you suggest.
\par > >
\par > > This problem is a little surprising, since we've got ImageProcessing() code
\par > > for 1BPP and 8BPP, that has no banding problems of this kind: this has been
\par > > released for a few years. Maybe the 4 planes / 1BPP is a special case?
\par > >
\par > > One approach that has **almost** worked:
\par > > 1. In OEMEnablePDEV, save the page length in pixels to OEMPDEV.
\par > > 2. In OEMStartDoc, save the band length to OEMPDEV.
\par > > 3. In OEMNextBand, save the accumulated band lengths to OEMPDEV.
\par > > If the end of the current band will overshoot the saved page length,
\par > > change pso->sizelBitmap->cy to the size that will match the end of page.
\par > > 4. In OEMStartPage, check the pso->sizelBitmap->cy against the saved initial
\par > >
\par > > bandsize, and reset it if necessary.
\par > >
\par > > This has eliminated the extra garbage data, but I'm now 1 pixel short /
\par > > page....
\par > > Thanks again for the suggestions--
\par > > Joe C.
\par > > --
\par > > J.C.
\par > >
\par > >
\par > > "JLC" wrote:
\par > >
\par > > >
\par > > > --
\par > > > J.C.
\par > > >
\par > > >
\par > > > "Bobby Mattappally [MS]" wrote:
\par > > >
\par > > > >
\par > > > > J.C,
\par > > > > I am not aware of any bugs in the unidrv banding code.
\par > > > > It is very unlikely (we would have heard about it long back)
\par > > > > Can you make sure you have read and followed comments section in the ddk
\par > > > > docs on "ImageProcessing
\par > > > > "?
\par > > > > Also look at the bitmap sample on server 2003 ddk to see an implementation
\par > > > > of imageprocessing.
\par > > > >
\par > > > > Hope this helps.
\par > > > >
\par > > > > Thank you,
\par > > > > Bobby Mattappally
\par > > > > Microsoft
\par > > > >
\par > > > > This posting is provided "AS IS" with no warranties, and confers no rights.
\par > > > >
\par > > > > --------------------
\par > > > > Thread-Topic: UNIDRV Banding Line Count error?
\par > > > >
\par > > > >
\par > > > > Hello,
\par > > > > I've got a rendering plugin with ImageProcessing doing RGB24 to CMYK
\par > > > > custom halftoning. (That is, DevNumPlanes = 4, DevBPP = 1, DrvBPP=
\par > > > > 24.) The conversion itself works fine, *except*:
\par > > > > when UNIDRV is doing banding, if the last band is shorter than
\par > > > > the previous bands, the difference (in lines) is added to the print as
\par > > > > garbage raster data.
\par > > > > E.G: for a 3300 line Letter page:
\par > > > > ImageProcessing reports 4 x bands of 664 lines, then one of 644.
\par > > > > What is printed is the 3300 lines expected, plus (664 - 644 =)20 lines
\par > > > > of garbage.
\par > > > > For a 3750 line page:
\par > > > > ImageProcessing reports 4 x bands of 752 lines, then one of 742.
\par > > > > The expected 3750 lines print, plus 10 lines (752 - 742) of garbage.
\par > > > >
\par > > > > It *looks* like when Unidrv splits the page into bands, it's not
\par > > > > tracking the actual count when passing the bands to Output.
\par > > > >
\par > > > > Comments? Suggestions??
\par > > > > I'd rather not do the compression and output
\par > > > > to spooler myself, if there's a known fix for this issue.
\par > > > > Thanks! -- Joe C.
\par > > > >
\par > > > > --
\par > > > > J.C
\par \pard
\par
\par }
------=_NextPart_0001_24F00593--