🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.postscript.programming
3 messages
3 total messages Started by Desmond_Anderson Thu, 08 Jul 2004 15:58
Spliting a large hex image into multiple strings
#488
Author: Desmond_Anderson
Date: Thu, 08 Jul 2004 15:58
23 lines
1686 bytes
Hi,
  Currently I have my image routine calling a string of hex values for presentation. The problem is when the hex string is larger than the string limit. I would like to keep it that way but break it up into 1 to n strings and put each strings on the stack when needed bye the image routine. I know that I can put the data inline but it does not serve my purpose. Does anyone have an idea of how I can accomplish that?

example:
/_fileProc {
       gsave
       /RawData _dtachk /ASCIIHexDecode filter def
       /Data RawData << >> /DCTDecode filter def
        /DeviceRGB setcolorspace
         { << /ImageType 1 /Width 546 /Height 356 /ImageMatrix [ 546 0 0 -356 0 356 ] /DataSource Data /BitsPerComponent 8 /Decode [0 1 0 1 0 1] >> image
           Data closefile
           RawData flushfile
       } exec
      grestore
} def
/_dtachk {_dta _dta1 } def
/_dta {(hex string.... )} def
/_dta1 {(hex string ....>)} def
_fileProc showpage

If I call _dta alone, it works.

Desmond
Re: Spliting a large hex image into multiple strings
#489
Author: Helge_Blischke
Date: Thu, 08 Jul 2004 16:32
1 lines
860 bytes
You'd have to make up an array of hex strings and change your data source to be a procedure which consumes all strings in the array as needed.
Re: Spliting a large hex image into multiple strings
#490
Author: Desmond_Anderson
Date: Thu, 08 Jul 2004 18:00
21 lines
1499 bytes
Hi Blischke,
   Thanks for responding. I did some changes (example below) but it only process the first one. I am not great at this so could please explain to me how I can force it to call the procedure again.
example:
/_fileProc {
    % gsave
       /RawData _dtachk /ASCIIHexDecode filter def
       /Data RawData << >> /DCTDecode filter def
        /DeviceRGB setcolorspace
         { << /ImageType 1 /Width 546 /Height 356 /ImageMatrix [ 546 0 0 -356 0 356 ] /DataSource Data /BitsPerComponent 8 /Decode [0 1 0 1 0 1] >> image
           %Data closefile
           %RawData flushfile
         % pop
       } exec
     % grestore
} def
/idx 0 def
/_dtachk {_dta idx get /idx idx 1 add def} def
/_dta {[(hex string1.... )(hex string2.... >)]} def

Thanks again,
Desmond
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