I am failing to get shfill to work for me. Below is a simplified version of what is going on: several of the numbers (1 7 div) are actually references to other PostScript variables the value of which are not yet known. Please, what's wrong?
In article <be046966-b3b4-452b-80b6-a2df7b6d6b69 @q15g2000yqj.googlegroups.com>, jdawise...@gmail.com says...
> I am failing to get shfill to work for me. Below is a simplified > version of what is going on: several of the numbers (1 7 div) are > actually references to other PostScript variables the value of which > are not yet known. Please, what's wrong?
For a type 0 (sampled) function the DataSource is defined to be either a string or a positionable file providing the sample data. You have provided a PostScript procedure. This will raise a typecheck error.
For a Type 0 function you *must* supply a BitsPerSample value, which is not present.
You cannot use a PostScript function as the basis for the data in a Function dictionary.
In article <a3c02902-55e0-42a2-8e43-c2d2de83c113 @a18g2000yqc.googlegroups.com>, jdawise...@gmail.com says...
> But is it possible to convert computed PostScript-function data to > either of the formats allowed in a function dictionary? And if so, > please, how?
Run the PostScript functions on a number of potential input values to generate the output data points. Take those data points, convert into string data, supply the string as a DataSource to the type 0 Function.
Interpolation will generate the intermediate points. FOr more accuracy, run more samples, cost is only more string data.
On Mar 9, 12:57 pm, jdaw1 <jdawise...@gmail.com> wrote:
> Thank you. As I'm happy for it to be linear, only the start and end > points are needed. Please, how can one> convert into string data, supply the string as a DataSource to the type 0 Function.
> ?
Converting to string: cvs
If you need a function for appending to an existing string, see comp.lang.postscript faqs (7.8 How can I concatenate two strings together?)
I have a Concatenate function. But how do I convert numbers on the stack, like 0.3284, to an appropriate strong format?
/ConcatenateOverflowErrorsSuppressed false def /Concatenate { 2 copy type exch type 2 copy /stringtype ne exch /stringtype ne or { 2 copy /arraytype eq exch /arraytype eq 4 2 roll /packedarraytype eq exch /packedarraytype eq 3 -1 roll or 3 1 roll or and not { (Error: Concatenate, types either unsuitable or non-matching) OutputToLog == == stop } {false} ifelse % not both arrays } {pop pop true} ifelse % either not a string 3 1 roll 2 copy length exch length add dup 65535 le { 4 -1 roll {string} {array} ifelse dup dup 0 5 index putinterval 4 -1 roll length 4 -1 roll putinterval } { % bool A B joint-size pop 3 -1 roll { 1 index length 65535 ge { pop ConcatenateOverflowErrorsSuppressed not { (Error: Concatenate, first string of maximal size. Suppressing reporting of further such errors.) OutputToLog /ConcatenateOverflowErrorsSuppressed true store } if % ConcatenateOverflowErrorsSuppressed not } { ConcatenateOverflowErrorsSuppressed not { (Error: Concatenate -- truncation, as objects jointly too long. Suppressing reporting of further such errors.) OutputToLog /ConcatenateOverflowErrorsSuppressed true store } if % ConcatenateOverflowErrorsSuppressed not 65535 string dup dup % A B string string string 0 5 index putinterval % A B string string 4 -1 roll length dup 65535 exch sub % B string string |A| 65535-| A| 5 -1 roll 0 3 -1 roll getinterval % string string |A| B' dup length 0 gt {putinterval} {pop pop} ifelse % string } ifelse % First object maximal length dup 65532 (...) putinterval } { ConcatenateOverflowErrorsSuppressed not { (Error: Concatenate, objects jointly too large, returning only first object. Suppressing reporting of further such errors.) OutputToLog /ConcatenateOverflowErrorsSuppressed true store } if % ConcatenateOverflowErrorsSuppressed not pop } ifelse % string } ifelse % fits within architectural limits
There is a path, consisting of a single curveto with the two internal control points being the same, so the path not self-intersecting. There are computed RGB values for the colours at the two ends. In between I want the colour to shift gradually from one to the other, and I don't care about the speed of colour variation.
Please, given real values X0 Y0 X1 Y1 X3 Y3, R0 G0 B0, R3 G3 B3, show me the code that makes it happen.
In this case the data must be binary, not ASCII, eg:
<0001020304> = 0x01 0x02 0x03 0x04 etc
To map the integer hex values into the domain of the function output you must supply a Decode array. Depending on the input, you may also find it necessary to supply an Encode array as well.
> To map the integer hex values into the domain of the function output you > must supply a Decode array. Depending on the input, you may also find it > necessary to supply an Encode array as well.
Thank you. But, please, would it be easy to post some code that could convert real variables R0 G0 B0 R3 G3 B3 into the appropriately- formatted DataSource / Encode / BitsPerSample data?
I have plenty of spare memory so BitsPerSample could happily be large. Unless that introduces new problems.
jdaw1 wrote: >> You cannot use a PostScript function as the basis for the data in a Function dictionary.
> But is it possible to convert computed PostScript-function data to > either of the formats allowed in a function dictionary? And if so, > please, how?
You can easily use a PostScript function as the basis for the data in a function dictionary.
That is one of PostScript's strongest features.
Exactly what are you trying to do?
-- Many thanks,
Don Lancaster voice phone: (928)428-4073 Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 rss: http://www.tinaja.com/whtnu.xml email: d...@tinaja.com