Created Date: 16 Mar, 2022 15:12
Last Modifed Date: 16 Mar, 2022 15:12


This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP.

The Harlequin RIP offers a plane of meta data for each pixel in the raster generated for a page. In Harlequin RIP terminology, this metadata plane is called the object map.

The object map was first a feature of the Harlequin RIP’s run-length encoded output format, but has since been introduced into (some of) the RIP’s contone color output modes.

The object map is only available with the Harlequin Core.

Raster output modes with object map support

Object map output is possible in the following output modes:

  • Run-length encoded (RLE) output (Harlequin Core only)
  • All contone output modes. The bit-depth of the object map must not exceed the output depth. The ObjectTypeMap array (see ObjectTypeMap pagedevice key) can be used to reduce the object map bit depth if necessary.

The mechanism of obtaining object map data in RLE differs from that of other output formats. For more information see RUN_OBJECT_TYPE in the RLE documentation.

Content of the object map

The value in the object map is an 8-bit container, where bit positions map to an object type, thus:

bit 0Set by the user. The setuserlabel operator (in internaldict) takes a boolean parameter, determining whether this bit is set or clear for objects created thereafter.
bit 1 Reserved for future use.
bit 2 Reserved for future use.
bit 3 Other (that is, not Text, vignette or Image)
bit 4 Text
bit 5 Vignette
bit 6 Image
bit 7 Composited (transparency)


For definitions of all object types, see Object types.

If the page is unmarked at the position a pixel represents, each bit in the object map for that pixel is 0.

If the pixel is the result of overprinting, the bit for each object type that formed the pixel is set. For example, if text overprints an image, bits 4 and 6 are both set.

The composited bit (7) declares that the pixel is the result of transparency compositing. The objects that were composited are indicated through bits 3 to 6. Overprinting on top of a composited pixel also leaves the composited bit set, even if the overprinting means that the pixel is now opaque.

If the RIP is generating 16-bit color output, the object map appears in a 16-bit container, but is still only 8-bits wide: it occupies the least significant 8-bits of the container, by default (for more information see ObjectTypeMap pagedevice key).

Delivery of the object map in contone output

In contone output, the object map is delivered through the same mechanism as each component of the color pixel, that is, as if it were a colorant.

The object map output is also configured using the same mechanism as used for colorant channels. In the Harlequin Core SDK, this requires configuring the ColorantFamilies description (see the Harlequin Core SDK Developer’s Guide). In the Harlequin MultiRIP, the colorant type channel supplied by the plugin should be set appropriately. Since the object map channel is treated the same as any other colorant, it can be interleaved in any order, omitted with other separations, appear in chunky (pixel-interleaved) or planar (band or frame interleaved) raster formats.

The example skin for the Harlequin Core provides support for discovering which channel is being delivered at any time:

  • The RasterDescription structure holds a linked list of RasterColorant structures. The list is in order of colorant channel delivery, and each RasterColorant has a string name for the channel. This name is the same as the channel name configured by the ColorantFamilies description.
  • The RASTER_write_data callback type includes a “channel” parameter, which informs the OEM code which channel from the list in RasterDescription is currently being delivered in the call to that RASTER_write_data callback.
  • A definition SW_PGB_SPECIALHANDLING_OBJECTMAP also exists to help recognize the object map channel.
  • The RIP core delivers a ColorantType page buffer parameter for each Colorant. This ColorantType parameter is an integer value the same as the ColorantType value configured by the ColorantFamilies description. It can be captured while parsing the page colorants, stored in the raster description, and used to test if a channel is an object map.

ObjectTypeMap pagedevice key

array

The ObjectTypeMap array allows the default bit positions of the object map to be rearranged, the object type to be reduced for lower bit-depth output, or the object type bits to be prioritized and mapped onto other type-related fields efficiently.

The ObjectTypeMap array implements a lookup table with 256 entries. The object type value (the combination of bits described in Content of the object map) is used as an index into this array. Values in the ObjectTypeMap are integers in the range 0 up to the maximum value representable in the output bit-depth; for example, 8-bit output values are in the range 0 255, while 16-bit output values are in the range 0 65535.

For example, for 8-bit color, the following mapping will set the object map values to 0 if nothing marked the pixel, 1 if a text object contributed to the pixel, and 2 if the pixel was marked with anything other than text:

            <<
            /ObjectTypeMap [ 0 1 255 { 120 and dup 0 eq {pop 0}{16 and 0 ne {1}{2}ifelse}ifelse } for
            ]
            >> setpagedevice
TEXT

In HHR/HMR v12 from v12.0r1: The TestConfig CMYKCompositeBand300dpiObjectTypeMap is supplied with the RIP and demonstrates ObjectTypeMap.

Out-of-range values are not allowed in the array and cause a rangecheck error in the setpagedevice call. If no array is specified, the code assumes an identity mapping.

There is no restriction on mapping multiple default values to the same map value, that is, you could map both index 0 (00000000) and index 2 (00000010) to 255 (11111111) if desired.

Thus it’s possible to generate a single hard mask where 0 means unmarked and 255 means marked, using:

<< /ObjectTypeMap [ 0 255 { 255 } repeat ] >> setpagedevice