Harlequin RIP SDK
sw_htm_instance Struct Reference

An instance structure for the modular halftone API implementation. More...

#include "swhtm.h"

Data Fields

const sw_htm_apiimplementation
 Pointer to the API implementation. More...
 
sw_memory_instancemem
 A memory allocator instance. More...
 
unsigned int src_bit_depth
 The source (contone) raster bit depth this instance requires.
 
HqBool want_object_map
 Whether screening this instance needs the object properties map provided in calls to sw_htm_api::DoHalftone(). More...
 
HqBool interrelated_channels
 Whether the halftone demands interrelated color channels. More...
 
unsigned int num_src_channels
 The number of source (contone) raster channels the RIP must pass to the screening module with each call to sw_htm_api::DoHalftone(). Ignored unless interrelated_channels is TRUE.
 
unsigned int num_dst_channels
 The number of destination (halftone) raster channels the RIP must pass to the screening module with each call to sw_htm_api::DoHalftone(). Ignored unless interrelated_channels is TRUE.
 
HqBool process_empty_bands
 Set this to TRUE if sw_htm_api::DoHalftone() must be called even when there are no pixels to be processed, i.e., the mask bitmap is all zeroes. If this is FALSE, the RIP will skip the call to sw_htm_api::DoHalftone() whenever it can.
 
unsigned int latency
 The number of previous bands that are needed by the screening algorithm. More...
 
sw_message_fnMessage
 A function to output a message to the RIP's monitor device. More...
 
unsigned int src_values_per_component
 The number of color values for each component of the source raster.
 

Detailed Description

An instance structure for the modular halftone API implementation.

This is the definition of a modular halftone instance. The RIP allocates memory for the instances, calling the sw_htm_api::HalftoneSelect() method to complete the details. The RIP uses this value in calls to sw_htm_api::DoHalftone() and sw_htm_api::HalftoneRelease(), to tell the module which halftone is being referred to.

The instance structure may be subclassed to hold private data by defining a subclass structure containing this structure as its first member, and using the size of that structure as the implementation's instance size. Individual methods may then downcast their instance pointer parameters to subclass pointers, and use the private data. e.g.,

typedef struct my_instance {
sw_htm_instance super ; // must be first entry
struct my_data *dynamic ;
int32 other_fields ;
} my_instance ;
static void RIPCALL my_HalftoneRelease(sw_htm_instance *inst)
{
my_instance *myinst = (my_instance *)inst ; // downcast to subclass
// free allocated data, if necessary:
inst->mem->implementation->free(inst->mem, myinst->dynamic) ;
} ;
const static sw_htm_api my_impl = {
{
(const uint8 *)"myname",
(const uint8 *)("A long description of my module implementation"
"\nCopyright (C) 2015 My Screen Design Company"),
sizeof(my_instance), // RIP will allocate this amount for instance
},
// ...more of sw_htm_api definition...
my_HalftoneRelease,
// ...rest of sw_htm_api definition...
} ;
// Call SwRegisterHTM(&my_impl) after SwInit() to register this module.
unsigned char uint8
8-bit unsigned integer
Definition: hqtypes.h:124
signed int int32
32-bit signed integer
Definition: hqtypes.h:122
@ SW_HTM_API_VERSION_20151027
Definition: swhtm.h:714
#define RIPCALL
The normal calling convention for RIP-exported APIs.
Definition: ripcall.h:27
The definition of an implementation of the modular halftoning interface.
Definition: swhtm.h:1616
An instance structure for the modular halftone API implementation.
Definition: swhtm.h:1478
sw_memory_instance * mem
A memory allocator instance.
Definition: swhtm.h:1502
void(* free)(sw_memory_instance *instance, void *memory)
Free a previously allocated block.
Definition: swmemapi.h:131
const sw_memory_api * implementation
Pointer to the API implementation.
Definition: swmemapi.h:89

The RIP will not touch memory beyond the size of the instance structure for the implementation version registered.

Field Documentation

◆ implementation

const sw_htm_api* sw_htm_instance::implementation

Pointer to the API implementation.

API methods for a halftone instance should always be called by indirecting through the instance's implementation field.

This field is filled in by the RIP before sw_htm_api::HalftoneSelect() is called.

◆ interrelated_channels

HqBool sw_htm_instance::interrelated_channels

Whether the halftone demands interrelated color channels.

Setting this to TRUE means that the screening module needs the RIP to screen several channels at once in each single call to sw_htm_api::DoHalftone() that uses this halftone instance. This must be FALSE for frame-interleaved output.

Attention
Must always be FALSE at present, because the RIP does not yet support interrelated channel screening.

◆ latency

unsigned int sw_htm_instance::latency

The number of previous bands that are needed by the screening algorithm.

The destination rasters for these will be available during sw_htm_api::DoHalftone() at the addresses that they were earlier presented at (so the module needs to remember dst_channels from earlier calls). The other buffers from earlier calls will not be available (but the module might store some of that data in its own buffers). If the algorithm just works on the current band, specify 0.

◆ mem

sw_memory_instance* sw_htm_instance::mem

A memory allocator instance.

This object is supplied by the RIP so that the halftone implementation can allocate memory using the RIP's memory allocator. halftone implementations should use this in preference to malloc() and free(), so that the RIP can track memory allocation and respond to low memory states more effectively.

This field is filled in by the RIP before sw_htm_api::HalftoneSelect() is called.

◆ Message

sw_message_fn* sw_htm_instance::Message

A function to output a message to the RIP's monitor device.

The length is limited to 1000 bytes including the zero terminator byte. End the message with a newline (\n) to avoid the next message (possibly from a different thread) being stuck to the end of it.

Deprecated:
from 20151027; Use monitor events instead.

◆ want_object_map

HqBool sw_htm_instance::want_object_map

Whether screening this instance needs the object properties map provided in calls to sw_htm_api::DoHalftone().

If this is FALSE, the sw_htm_dohalftone_request::object_props_map field of the structure passed to sw_htm_api::DoHalftone() will always be NULL.


The documentation for this struct was generated from the following file: