Harlequin RIP SDK
swrle.h File Reference

This file provides the information needed to interpret run-length output from the pagebuffer device. More...

Macros

#define RUN_SIMPLE   0u
 RLE simple run opcode. More...
 
#define RUN_REPEAT   1u
 RLE repeated run opcode. More...
 
#define RUN_POSITION   2u
 RLE set run position opcode. More...
 
#define RUN_SCREEN   3u
 RLE set run screen opcode. More...
 
#define RUN_HEADER   4u
 RLE block header opcode. More...
 
#define RUN_END_OF_LINE   5u
 RLE end of line run opcode. More...
 
#define RUN_NO_OP   6u
 RLE no-op opcode. More...
 
#define RUN_REPEAT_COPY   8u
 RLE run repeat copy opcode. More...
 
#define RUN_REPEAT_STORE   9u
 RLE run repeat store opcode. More...
 
#define RUN_SCREEN_STORE   10u
 RLE run repeat store opcode. More...
 
#define RUN_COLORANTS   11u
 Color RLE colorant definition opcode. More...
 
#define RUN_COLORANTS_LONG   12u
 Color RLE colorant definition opcode. More...
 
#define RUN_INFO   13u
 Color RLE information record definition opcode. More...
 
#define RUN_PARTIAL_OVERPRINT   14u
 Color RLE partial overprint definition opcode. More...
 
#define RUN_PARTIAL_OVERPRINT_LONG   15u
 Color RLE partial overprint definition opcode. More...
 
#define RUN_OBJECT_TYPE   16u
 RLE object type opcode. More...
 
#define RLE_BLOCK_SIZE_WORDS   258
 
#define RLE_USER_OBJECT   (1 << 0)
 
#define RLE_UNUSED1   (1 << 1)
 
#define RLE_UNUSED2   (1 << 2)
 
#define RLE_LW_OBJECT   (1 << 3)
 
#define RLE_TEXT_OBJECT   (1 << 4)
 
#define RLE_SHADING_OBJECT   (1 << 5)
 
#define RLE_IMAGE_OBJECT   (1 << 6)
 
#define RLE_COMPOSITED_OBJECT   (1 << 7)
 
#define POINTER_SIZE_IN_WORDS   2
 
#define RLEBLOCK_SET_NEXT(block_, next_)
 
#define RLEBLOCK_GET_NEXT(block_)    (*(uint32**)(block_))
 
#define RLE_GET_RECORD_TYPE(recordHeader_)    ((recordHeader_) & RLE_MASK_RECORD_TYPE)
 
#define RLEBLOCK_HEADER_SIZE   (POINTER_SIZE_IN_WORDS + 1)
 
#define RLEBLOCK_GET_HEADER(block_)    ((block_)[POINTER_SIZE_IN_WORDS])
 
#define RLEBLOCK_GET_CONTENTS(block_)    ((block_) + RLEBLOCK_HEADER_SIZE)
 
#define RLEBLOCK_GET_SIZE(block_)    (int32)((block_)[POINTER_SIZE_IN_WORDS] >> 16)
 

Detailed Description

This file provides the information needed to interpret run-length output from the pagebuffer device.

Copyright (C) 2020 Global Graphics Software Ltd. All rights reserved. Global Graphics Software Ltd. Confidential Information. This source code contains the confidential and trade secret information of Global Graphics Software Ltd. It may not be used, copied or distributed for any reason except as set forth in the applicable Global Graphics license agreement.

Macro Definition Documentation

◆ POINTER_SIZE_IN_WORDS

#define POINTER_SIZE_IN_WORDS   2

The size of a pointer linking RLE blocks together.

◆ RLE_BLOCK_SIZE_WORDS

#define RLE_BLOCK_SIZE_WORDS   258

Maximum size of an RLE block in 32 bit words.

◆ RLE_COMPOSITED_OBJECT

#define RLE_COMPOSITED_OBJECT   (1 << 7)

◆ RLE_GET_RECORD_TYPE

#define RLE_GET_RECORD_TYPE (   recordHeader_)     ((recordHeader_) & RLE_MASK_RECORD_TYPE)

Extract the type of an RLE record from its header.

◆ RLE_IMAGE_OBJECT

#define RLE_IMAGE_OBJECT   (1 << 6)

◆ RLE_LW_OBJECT

#define RLE_LW_OBJECT   (1 << 3)

◆ RLE_SHADING_OBJECT

#define RLE_SHADING_OBJECT   (1 << 5)

◆ RLE_TEXT_OBJECT

#define RLE_TEXT_OBJECT   (1 << 4)

◆ RLE_UNUSED1

#define RLE_UNUSED1   (1 << 1)

Reserved for future use.

◆ RLE_UNUSED2

#define RLE_UNUSED2   (1 << 2)

Reserved for future use.

◆ RLE_USER_OBJECT

#define RLE_USER_OBJECT   (1 << 0)

◆ RLEBLOCK_GET_CONTENTS

#define RLEBLOCK_GET_CONTENTS (   block_)     ((block_) + RLEBLOCK_HEADER_SIZE)

Return a pointer to the contents of the block.

◆ RLEBLOCK_GET_HEADER

#define RLEBLOCK_GET_HEADER (   block_)     ((block_)[POINTER_SIZE_IN_WORDS])

Return the block header word.

◆ RLEBLOCK_GET_NEXT

#define RLEBLOCK_GET_NEXT (   block_)     (*(uint32**)(block_))

Given a pointer to a block, return a pointer to the next block.

◆ RLEBLOCK_GET_SIZE

#define RLEBLOCK_GET_SIZE (   block_)     (int32)((block_)[POINTER_SIZE_IN_WORDS] >> 16)

Return the size of the passed block, in bytes, including the size of the header word.

◆ RLEBLOCK_HEADER_SIZE

#define RLEBLOCK_HEADER_SIZE   (POINTER_SIZE_IN_WORDS + 1)

The macro evaluates to the size of an RLE block header in words - the next pointer and the RUN_HEADER record together make the header.

◆ RLEBLOCK_SET_NEXT

#define RLEBLOCK_SET_NEXT (   block_,
  next_ 
)
Value:
{ \
uint32** link_ = (uint32**)(block_); \
*link_ = next_; \
}
uint32_t uint32
32-bit unsigned integer
Definition: hqtypes.h:92

Write the pointer to the next block to the start of the passed block.

The size of this pointer is specified by POINTER_SIZE_IN_WORDS.

◆ RUN_COLORANTS

#define RUN_COLORANTS   11u

Color RLE colorant definition opcode.

  • bits 0-5: record type
  • bit 6: (unused)
  • bit 7: overprint (1) or knockout (0) implicit colorants
  • bits 29-31: number of colorant-numbers (color components)
  • bits 26-28: colorant-number
  • bits 23-25: colorant-number ...

◆ RUN_COLORANTS_LONG

#define RUN_COLORANTS_LONG   12u

Color RLE colorant definition opcode.

  • bits 0-5: record type
  • bit 6: (unused)
  • bit 7: overprint (1) or knockout (0) implicit colorants
  • bits 8-9: (unused)
  • bits 10-19: first colorant-number
  • bits 20-29: number of colorant-numbers (color componments)
  • bits 30-31: (unused)

Followed by as many words as are needed to store remaining colorant-numbers, packed 3 to a word in bits 20-29, 10-19 and 0-9 in that order.

◆ RUN_END_OF_LINE

#define RUN_END_OF_LINE   5u

RLE end of line run opcode.

  • bits 0-5: record type
  • bits 8-31: reserved

◆ RUN_HEADER

#define RUN_HEADER   4u

RLE block header opcode.

  • bits 0-5: record type
  • bits 8-15: flag-value (must be set to zero when block is free)
  • bits 16-31: block length in bytes

◆ RUN_INFO

#define RUN_INFO   13u

Color RLE information record definition opcode.

  • bits 0-5: record type
  • bit 6: (unused)
  • bit 7: re-use bit
  • bits 8-11: count
  • bits 12-15: type
  • bits 16-31: identifier

Followed by as many words as required for information of this type, except when re-use is set when the consumer should refer to the previous value for the given identifier.

◆ RUN_NO_OP

#define RUN_NO_OP   6u

RLE no-op opcode.

  • bits 0-5: record type
  • bits 8-31: reserved

◆ RUN_OBJECT_TYPE

#define RUN_OBJECT_TYPE   16u

RLE object type opcode.

  • bits 0-5: record type
  • bits 8-15: object type

Specifies the type of object (or objects, in the case of a composited span) from which this span originated. Plus the rendering intent.

◆ RUN_PARTIAL_OVERPRINT

#define RUN_PARTIAL_OVERPRINT   14u

Color RLE partial overprint definition opcode.

  • bits 0-5: record type
  • other bits: as per RUN_COLORANTS (use the same masks and shifts), but numbers identify colorants partially overprinted. /RunPartialOverprint true required to receive this opcode

◆ RUN_PARTIAL_OVERPRINT_LONG

#define RUN_PARTIAL_OVERPRINT_LONG   15u

Color RLE partial overprint definition opcode.

  • bits 0-5: record type
  • other bits: as per RUN_COLORANTS_LONG (use the same masks and shifts), but numbers identify colorants partially overprinted. /RunPartialOverprint true required to receive this opcode

◆ RUN_POSITION

#define RUN_POSITION   2u

RLE set run position opcode.

  • bits 0-5: record type
  • bits 8-31: position

◆ RUN_REPEAT

#define RUN_REPEAT   1u

RLE repeated run opcode.

  • bits 0-5: record type
  • bits 6-7: (unused)
  • bits 8-23: run-count
  • bits 24-31: (unused)

Mono only: then run-count pairs of tone-index, repeat-count bytes packed two pairs to a 32-bit word)

Color RLE only: run-count groups of 10 bit fields packed into bytes 20-29, 10-19 and 0-9 for as many words as necessary, where the first field of each run (subject to bits 30-31, see below) is a 6-bit repeat count stored in the least significant bits of the 10-bit field, and the remaining fields supply color-values for each explicit colorant of the current set of colorants given by RUN_COLORANTS.

For those words where a new run starts, bits 30-31 are interpreted as:

  • 0 - repeat count omitted, use the same as the previous one,
  • 1 - repeat count is omitted, it is one greater than the previous one,
  • 2 - repeat count is present,
  • 3 - repeat count is one less than the previous one

There are special cases for one and two component colors - see manual.

◆ RUN_REPEAT_COPY

#define RUN_REPEAT_COPY   8u

RLE run repeat copy opcode.

  • bits 0-5: record type
  • bits 8-23: reserved
  • bits 24-31: repeat id stored with previous RUN_REPEAT_STORE.

◆ RUN_REPEAT_STORE

#define RUN_REPEAT_STORE   9u

RLE run repeat store opcode.

  • bits 0-5: record type
  • bits 8-23: pair-count (then pair-count pairs as for RUN_REPEAT)
  • bits 24-31: repeat id.

◆ RUN_SCREEN

#define RUN_SCREEN   3u

RLE set run screen opcode.

  • bits 0-5: record type
  • bits 8-31: screen-index

◆ RUN_SCREEN_STORE

#define RUN_SCREEN_STORE   10u

RLE run repeat store opcode.

  • bits 0-5: record type
  • bits 8-23: screen index
  • bits 24-31: number of words of data to follow (this data is hardware specific)

◆ RUN_SIMPLE

#define RUN_SIMPLE   0u

RLE simple run opcode.

  • bits 0-5: record type
  • bits 8-15: tone-index (6-15 for 10-bit case) or first color-value (color RLE)
  • bits 16-31: repeat-count