Thread View: comp.lang.postscript
2 messages
2 total messages
Started by Dave Bradford
Mon, 16 Nov 1992 23:12
Lev 2 Image Dictionary Question
Author: Dave Bradford
Date: Mon, 16 Nov 1992 23:12
Date: Mon, 16 Nov 1992 23:12
46 lines
1732 bytes
1732 bytes
I am trying to write a color raster level 2 PostScript driver
using run length encoding. My problem is that my data seems
to be interpreted as RGB, RGB, ... instead of:
RRRRRRRRRR
GGGGGGGGGG
BBBBBBBBBB
I figure that by separating the color components by scanline I
can get the most out of RLE encoding. I have been succesful
using the level 1 colorimage operator with true 3 (multiple
data source, 3 colors) but in the process of switching to
level 2 and using the image dictionary and image filters I
have not had any luck.
Here is a sample of what I have tried (without compression):
initgraphics
/inch {72 mul} def
/width 300 def
/height 300 def
/finalwidth 1.00 inch def
/DeviceRGB setcolorspace
18 18 translate
finalwidth finalwidth width div height mul scale
/rline currentfile /ASCIIHexDecode filter def
/gline currentfile /ASCIIHexDecode filter def
/bline currentfile /ASCIIHexDecode filter def
gsave
<<
/ImageType 1
/Width width /Height height
/MultipleDataSources true
/BitsPerComponent 8
/Decode [0 1 0 1 0 1]
/ImageMatrix [width 0 0 height neg 0 height]
/DataSource [rline gline bline]
>>
image
....... data not included ......
Any help is very much appreciated.
--
Dave Bradford dave@maven.b29.ingr.com (Internet)
Re: Lev 2 Image Dictionary Question
Author: Stephen Zisk
Date: Tue, 17 Nov 1992 17:26
Date: Tue, 17 Nov 1992 17:26
46 lines
2648 bytes
2648 bytes
In article <1992Nov16.231218.16989@infonode.ingr.com>,
dave@maven.b29.ingr.com (Dave Bradford) wrote:
>
> I am trying to write a color raster level 2 PostScript driver
> <some lines removed>
> /rline currentfile /ASCIIHexDecode filter def
> /gline currentfile /ASCIIHexDecode filter def
> /bline currentfile /ASCIIHexDecode filter def
> <more lines removed>
> /DataSource [rline gline bline]
> <more lines removed>
The problem here is simple: Your three data sources are not truly
independent.
You are making a presumption about the order in which the interpreter calls
your data sources. In order to use three separate data sources, you would
have
to have three files (or strings, or whatever) which could be accessed in
any
order, without regard to interrelationships. See the Red Book (2nd
edition):
p. 214 (last paragraph) - "The three sources... must actually be
independent"
p. 215 (diagram) - Note the bracketed "independent"
p. 225 (first paragraph under "Color Image with Single Source.") -
"The first organization is the only one that is useful for images
whose data are provided in-line in a PostScript language program.
The second organization is limited to situations in which the
separate components are stored elsewhere, such as in separate
files that can be read in parallel."
If the image data were small enough to be stored in strings, you could pre-
define the individual strings and use them in the image operator. The fact
that your code worked on some Level 1 implementations is, unfortunately,
device-dependent. You were depending on the device reading all the red
data,
then all the green, then the blue. Many devices did just this when allowed,
but this is not a standard. That is why the "independent" was stressed so
much in the new Red Book. Sorry!
Stephen Zisk (zisk@adobe.com) Disclaimer: These are my personal opinions
and
Adobe Systems Incorporated do not represent the views of Adobe Systems
Eastern Regional Office Incorporated.
24 New England Exec. Park
Burlington, MA 01803 They pay me but they don't muzzle me!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads