[gs-devel] Reusable streams and shading patterns
Igor V. Melichev
igor at artifex.com
Thu Sep 26 09:44:17 PDT 2002
Alex,
PLRM says that makepattern copies the argument dictionary, but
doesn't copy its referents. Therefore the shading dictionary must not copy,
i.e. it must exist as a single instance.
Then we apply same shading 2 times. IMO it is not important,
whether it is used in makepattern or elsewhere (for instance, with shfill).
PLRM says, that shfill consumes the data source only once.
I've checked fileposition before makepattern, before fill and after it.
GS and CPSI work differently : CPSI consumes the data while fill,
but GS does while makepattern. It looks like Adobe interpretes
setpattern+fill as shfill, but makepattern with shadings is dummy.
Therefore I think that your test is incorrect Postscript.
Then we have 2 alternatives : either the distilled file is incorrect,
or it's a bug in PDF interpreter. Can you check which one have place ?
Thank you.
Igor.
-----Original Message-----
From: gs-devel-admin at ghostscript.com
[mailto:gs-devel-admin at ghostscript.com]On Behalf Of Alex Cherepanov
Sent: Thursday, September 26, 2002 1:56 AM
To: gs-devel at ghostscript.com
Subject: [gs-devel] Reusable streams and shading patterns
Looking into bug #602016 "rangecheck in fill (distilled 446-01.ps)"
I've found that it is necessary to rewind reusable stream used as
data source in shading pattern before applying makepattern
operator. I'm asking GS architects whether the current behavior is
correct. Included is a short sample program.
If GS makepattern is correct we need to fix PDF interpreter.
This patch was submitted to code review.
If GS makepattern is broken we need to fix it instead.
This program fails on GS and Adobe interpreters
but works on Jaws and Harlequin.
%!
/sha
<<
/ShadingType 5
/AntiAlias true
/ColorSpace /DeviceRGB
/Decode [ -16384 16384 -16384 16384 0 1 0 1 0 1 ]
/BitsPerCoordinate 24
/BitsPerComponent 16
/VerticesPerRow 3
/DataSource
currentfile /ASCIIHexDecode filter /ReusableStreamDecode filter
7F 60 00 80 C8 00 7F FF FF FF 3F FF 7F 60 00
80 78 00 3F FF BF FF 7F FF 80 00 00 80 C8 00 BF
FF BF FF 00 00 80 00 00 80 78 00 7F FF 7F FF 7F
FF 80 A0 00 80 C8 00 FF FF 7F FF 3F FF 80 A0 00
80 78 00 BF FF 3F FF 7F FF 7F 60 00 80 78 00 3F
FF BF FF 7F FF 7F 60 00 80 28 00 00 00 7F FF BF
FF 80 00 00 80 78 00 7F FF 7F FF 7F FF 80 00 00
80 28 00 3F FF 3F FF FF FF 80 A0 00 80 78 00 BF
FF 3F FF 7F FF 80 A0 00 80 28 00 7F FF 00 00 BF
FF >
>> def
/pat
<< /PatternType 2
/Shading sha
>> def
/Pattern setcolorspace
pat [10 0 0 10 0 0] makepattern setcolor
100 200 200 200 rectfill
% pat /Shading get /DataSource get 0 setfileposition
pat [10 0 0 10 0 0] makepattern setcolor
110 210 200 200 rectfill
showpage
%%EOF
_______________________________________________
gs-devel mailing list
gs-devel at ghostscript.com
http://www.ghostscript.com/mailman/listinfo/gs-devel
More information about the gs-devel
mailing list