创建Postscript函数字典类型0

时间:2010-11-23 18:20:07

标签: postscript

我正在尝试创建类型为0的Postscript函数字典。输入是单维,输出是3维。 输入0输出[0 0 0] 输入1输出[1 1 1] 我在为这个函数字典编写DataSource时遇到了麻烦。 PLRM手册说DataSource必须是字符串或纯二进制数据。有人可以帮助我将这些值映射到DataSource期望的格式吗?

/ FunctionType 0 /域名[0 1] /范围[0 1 0 1 0 1] /订单1 / BitsPerSample 8 /尺寸[2] / DataSource ????

感谢。

2 个答案:

答案 0 :(得分:2)

根据PLRM,/ DataSource是字符串或文件。假设您的样本值为0x00和0xFF。

对于字符串,请使用如下的十六进制字符串:

/DataSource <00FF>

文件方法更复杂,两个字节的样本数据效率低下。除非你真的需要从文件中读取数据,否则我不会在这里显示。

答案 1 :(得分:2)

好的,根据你的评论,我就是这样做的:

<< % Make gradient pattern dictionary
  /PatternType 2
  /Shading
  <<
    /ShadingType 2
    /ColorSpace /DeviceRGB
    /Coords [ 0 0 72 72 ] % Set coord array (gradient starting point to ending point)
    /Function
    <<
      /FunctionType 2
      /Domain [ 0 1 ]
      /C0 [ 1 1 1 ] % Set color 1 (white in RGB space)
      /C1 [ 0 0 0 ] % Set color 2 (black in RGB space)
      /N 1
    >>
  >>
>>
matrix makepattern

这是0,0 0,72 72,72 72,0的示例方格。

相关问题