Skip to main content
June 30, 2015
Question

colorimage operator with binary data

  • June 30, 2015
  • 1 reply
  • 983 views

Hello,

I have an embedded system with a OpenHCI driver which controls an USB postscript printer.

A Cmos sensor stores raw RGB image data in RAM.

I would like print this images creating a ps file and sent it to the printer.

Colorimage seems the right operator for this issue but it requires data encoded,

for example as ASCII hexadecimal, and this mean a lot of computational costs for my little embedded system.

Is there a way to include binary data to ps file and feed colorimage without encode them ?

Thank you.

This topic has been closed for replies.

1 reply

Legend
July 1, 2015

colorimage does not REQUIRE encoded data. Are you looking at the PostScript Reference or trying to pick this up from examples?

Some communications channels to printers do not allow binary data. This is not a limitation of colorimage. You will have to study your printer to see if these limitations apply.

If you are concerned about file size (usually the limiting factor), the ASCII85Decode filter is a good choice in this case, because it has a lower overhead than hex. If you are really concerned about the computational costs of generating the data, I don't think you need to be: converting to hex can be extremely computationally cheap, if you avoid calling a routine for each byte and instead fill interim buffers without using formatting routines.