This is an old version from the tos.hyp. The new is on GitHub!

HomeVDIControl functionsVDI functions list

7.11 Raster functions

This library contains functions for manipulating rectangular blocks of bits in memory. The following routines are available for this purpose:

v_get_pixel Gets pixel status (set or cleared, colour)
vq_hilite_color Gets highlighting colour
vq_max_color Gets maximum colour value for an additive raster operation
vq_min_color Gets minimum colour value for a subtractive raster operation
vq_weight_color Gets weighting for the blend function
vr_clip_rects_by_dst Cuts destination rectangle with a clipping rectangle
vr_clip_rects_by_src Cuts source rectangle with a clipping rectangle
vr_clip_rects32_by_dst Cuts destination rectangle with a clipping rectangle (32-bit coordinates)
vr_clip_rects32_by_src Cuts source rectangle with a clipping rectangle (32-bit coordinates)
vr_transfer_bits Combines two bitmaps
vr_trnfm Transforms raster to device-specific formats and vice versa
vro_cpyfm Copies ('blits') a screen or memory block from one location to another (opaque)
vrt_cpyfm Copies ('blits') a screen or memory block from one location to another (transparent)
vs_hilite_color Sets highlighting colour
vs_max_color Sets maximum colour value for an additive raster operation
vs_min_color Sets minimum colour value for a subtractive raster operation
vs_weight_color Sets weighting for the blend function

Note: With these functions it is possible, in particular, to copy or move a screen area from one place to another; thanks to this one can obtain smooth scrolling in GEM programs, for instance.

See also: Raster formats   Off-screen bitmaps   VDI workstations

7.11.1 v_get_pixel

Name: »Get pixel« - Returns the colour value of a pixel.
Opcode: 105
Syntax: void v_get_pixel ( int16_t handle, int16_t x, int16_t y, int16_t *pel, int16_t *index );
Description: The call v_get_pixel obtains the pixel value and the colour index of a pixel for resolutions up to 256 colours (8 planes). The following apply:
Parameter Meaning
   
handle Workstation identifier
x X-coordinate of pixel
y Y-coordinate of pixel
pel Pixel value
index Colour index


Note: The colour index is understood as the number that can be specified for the attribute functions of the VDI. The pixel value, on the other hand, represents the actual contents of the screen memory.

In HiColor (15 or 16 bits) pel contains the pixel value and index is (usually) -1, as it cannot be allocated beyond doubt. In TrueColor pel contains the low word and index the high word of the pixel value.
Return value: The function does not return a result.
Availability: Supported by all screen drivers.
Group: Raster functions
See also: Binding   Raster formats

7.11.2 Bindings for v_get_pixel

C: void v_get_pixel ( int16_t handle, int16_t x, int16_t y, int16_t *pel, int16_t *index );
Binding:
void v_get_pixel (int16_t handle, int16_t x, int16_t y,
                  int16_t *pel, int16_t *index)
{
   ptsin[0]  = x;
   ptsin[1]  = y;
   contrl[0] = 105;
   contrl[1] = 1;
   contrl[3] = 0;
   contrl[6] = handle;

   vdi ();

   *pel   = intout[0];
   *index = intout[1];
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 105 # Function opcode
contrl+2 contrl[1] 1 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 2 # Entry in intout
contrl+12 contrl[6] handle
ptsin ptsin[0] x
ptsin+2 ptsin[1] y
intout intout[0] pel
intout+2 intout[1] index

7.11.3 vq_hilite_color

Name: »Inquire hilite colour« - Obtain highlighting colour.
Opcode: 209 (Sub-Opcode 0)
Syntax: int32_t vq_hilite_color( int16_t handle, COLOR_ENTRY *hilite_color );
Description: The call vq_hilite_color obtains the highlighting colour. The following apply:
Parameter Meaning
   
handle Workstation identifier
hilite_color COLOR_ENTRY of the highlighting colour
Return value: Colour space set.
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.4 Bindings for vq_hilite_color

C: int32_t vq_hilite_color( int16_t handle, COLOR_ENTRY *hilite_color );
Binding:
int32_t vq_hilite_color( int16_t handle,
                         COLOR_ENTRY *hilite_color )
{
   contrl[0] = 209;
   contrl[1] = 0;
   contrl[3] = 0;
   contrl[5] = 0;
   contrl[6] = handle;

   vdi ();

   hilite_color = intout[2..5];

   return ( intout[0..1] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 209 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 6 # Entry in intout
contrl+10 contrl[5] 0 # Sub-opcode
contrl+12 contrl[6] handle
intout intout[0..1] Return value
intout+4 intout[2..5] hilite_color

7.11.5 vq_max_color

Name: »Inquire maximum colour«
Opcode: 209 (Sub-Opcode 2)
Syntax: int32_t vq_max_color( int16_t handle, COLOR_ENTRY *max_color );
Description: The call vq_max_color obtains the maximum colour value for an additive raster operation.
Parameter Meaning
   
handle Workstation identifier
max_color COLOR_ENTRY of the maximum colour value for T_ADD
Return value: Colour space set.
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.6 Bindings for vq_max_color

C: int32_t vq_max_color( int16_t handle, COLOR_ENTRY *max_color );
Binding:
int32_t vq_max_color( int16_t handle, COLOR_ENTRY *max_color )
{
   contrl[0] = 209;
   contrl[1] = 0;
   contrl[3] = 0;
   contrl[5] = 2;
   contrl[6] = handle;

   vdi ();

   max_color = intout[2..5];
   return ( intout[0..1] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 209 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 6 # Entry in intout
contrl+10 contrl[5] 2 # Sub-opcode
contrl+12 contrl[6] handle
intout intout[0..1] Return value
intout+4 intout[2..5] max_color

7.11.7 vq_min_color

Name: »Inquire minimum colour«
Opcode: 209 (Sub-Opcode 1)
Syntax: int32_t vq_min_color( int16_t handle, COLOR_ENTRY *min_color );
Description: The call vq_min_color obtains the minimum colour value for a subtractive raster operation (T_SUB).
Parameter Meaning
   
handle Workstation identifier
min_color COLOR_ENTRY of the minimum colour value for T_SUB
Return value: Colour space set.
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.8 Bindings for vq_min_color

C: int32_t vq_min_color( int16_t handle, COLOR_ENTRY *min_color );
Binding:
int32_t vq_min_color( int16_t handle, COLOR_ENTRY *min_color )
{
   contrl[0] = 209;
   contrl[1] = 0;
   contrl[3] = 0;
   contrl[5] = 1;
   contrl[6] = handle;

   vdi ();

   min_color = intout[2..5];
   return ( intout[0..1] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 209 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 6 # Entry in intout
contrl+10 contrl[5] 1 # Sub-opcode
contrl+12 contrl[6] handle
intout intout[0..1] Return value
intout+4 intout[2..5] min_color

7.11.9 vq_weight_color

Name: »Inquire weight colour«
Opcode: 209 (Sub-Opcode 3)
Syntax: int32_t vq_weight_color( int16_t handle, COLOR_ENTRY *weight_color );
Description: The call vq_weight_color obtains the weighting for the blend function (T_BLEND).
Parameter Meaning
   
handle Workstation identifier
weight_color COLOR_ENTRY of weighting for T_BLEND
Return value: Colour space set.
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.10 Bindings for vq_weight_color

C: int32_t vq_weight_color( int16_t handle, COLOR_ENTRY *weight_color );
Binding:
int32_t vq_weight_color( int16_t handle,
                         COLOR_ENTRY *weight_color )
{
   contrl[0] = 209;
   contrl[1] = 0;
   contrl[3] = 0;
   contrl[5] = 3;
   contrl[6] = handle;

   vdi ();

   weight_color = intout[2..5];
   return ( intout[0..1] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 209 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 6 # Entry in intout
contrl+10 contrl[5] 3 # Sub-opcode
contrl+12 contrl[6] handle
intout intout[0..1] Return value
intout+4 intout[2..5] weight_color

7.11.11 vr_clip_rects32_by_dst

Name: »Clip Rects By Destination Rectangle«
Opcode: 171 (Sub-Opcode 2)
Syntax: int16_t vr_clip_rects32_by_dst ( int16_t handle, RECT32 *dst_clip_rect, RECT32 *src_rect, RECT16 *dst_rect, RECT32 *clipped_src_rect, RECT32 *clipped_dst_rect );
Description: The call vr_clip_rects32_by_dst cuts the destination rectangle with a clipping rectangle and adapts the source rectangle, using 32-bit coordinates.
Parameter Meaning
   
handle Workstation identifier
dst_clip_rect Clipping rectangle for destination (continuous coordinates, 32-bit)
src_rect Source rectangle (continuous coordinates, 32-bit)
dst_rect Destination rectangle (continuous coordinates, 32-bit)
clipped_src_rect Clipped source rectangle (continuous coordinates, 32-bit)
clipped_dst_rect Clipped destination rectangle (continuous coordinates, 32-bit)
Return value: 0: No clipping of the rectangles
1: All OK
Availability: As of NVDI 5.02.

If the driver offers the new rasterizing functions, then bit 2 will be set in work_out[30] in the extended parameters of vq_extnd.
Group: Raster functions
See also: Binding

7.11.12 Bindings for vr_clip_rects32_by_dst

C: int16_t vr_clip_rects32_by_dst ( int16_t handle, RECT32 *dst_clip_rect, RECT32 *src_rect, RECT16 *dst_rect, RECT32 *clipped_src_rect, RECT32 *clipped_dst_rect );
Binding:
int16_t vr_clip_rects32_by_dst ( int16_t handle,
                                 RECT32 *dst_clip_rect,
                                 RECT32 *src_rect,
                                 RECT16 *dst_rect,
                                 RECT32 *clipped_src_rect,
                                 RECT32 *clipped_dst_rect )
{
   ptsin[0..7] = dst_clip_rect;
   ptsin[8..15] = src_rect;
   ptsin[16..23] = dst_rect;

   contrl[0] = 171;
   contrl[1] = 12;
   contrl[3] = 0;
   contrl[5] = 2;
   contrl[6] = handle;

   vdi ();

   clipped_src_rect = ptsout[0..7];
   clipped_dst_rect = ptsout[8..15];

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 171 # Function opcode
contrl+2 contrl[1] 12 # Entry in ptsin
contrl+4 contrl[2] 8 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 2 # Sub-opcode
contrl+12 contrl[6] handle
ptsin ptsin[0..7] dst_clip_rect
ptsin+16 ptsin[8..15] src_rect
ptsin+32 ptsin[16..23] dst_rect
ptsout ptsout[0..7] clipped_src_rect
ptsout+16 ptsout[8..15] clipped_dst_rect
intout intout[0] Return value

7.11.13 vr_clip_rects32_by_src

Name: »Clip rectangles by source rectangle«
Opcode: 171 (Sub-Opcode 3)
Syntax: int16_t vr_clip_rects32_by_src ( int16_t handle, RECT32 *src_clip_rect, RECT32 *src_rect, RECT16 *dst_rect, RECT32 *clipped_src_rect, RECT32 *clipped_dst_rect );
Description: The call vr_clip_rects32_by_src cuts the source rectangle with a clipping rectangle, using 32-bit coordinates (this function respects the rounding behaviour of vr_transfer_bits). The following apply:
Parameter Meaning
   
handle Workstation identifier
src_clip_rect Clipping rectangle for the source (continuous coordinates, 32-bit)
src_rect Source rectangle (continuous coordinates, 32-bit)
dst_rect Destination rectangle (continuous coordinates, 32-bit)
clipped_src_rect Clipped source rectangle (continuous coordinates, 32-bit)
clipped_dst_rect Clipped destination rectangle (continuous coordinates, 32-bit)
Return value: 0: No clipping of the rectangles
1: All OK
Availability: As of NVDI 5.02.

If the driver offers the new clip functions, then bit 2 will be set in work_out[30] in the extended parameters of vq_extnd.
Group: Raster functions
See also: Binding   vr_transfer_bits

7.11.14 Bindings for vr_clip_rects32_by_src

C: int16_t vr_clip_rects32_by_src ( int16_t handle, RECT32 *src_clip_rect, RECT32 *src_rect, RECT16 *dst_rect, RECT32 *clipped_src_rect, RECT32 *clipped_dst_rect );
Binding:
int16_t vr_clip_rects32_by_src ( int16_t handle,
                                 RECT32 *src_clip_rect,
                                 RECT32 *src_rect,
                                 RECT16 *dst_rect,
                                 RECT32 *clipped_src_rect,
                                 RECT32 *clipped_dst_rect )
{
   ptsin[0..7] = src_clip_rect;
   ptsin[8..15] = src_rect;
   ptsin[16..23] = dst_rect;

   contrl[0] = 171;
   contrl[1] = 12;
   contrl[3] = 0;
   contrl[5] = 3;
   contrl[6] = handle;

   vdi ();

   clipped_src_rect = ptsout[0..7];
   clipped_dst_rect = ptsout[8..15];

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 171 # Function opcode
contrl+2 contrl[1] 12 # Entry in ptsin
contrl+4 contrl[2] 8 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 3 # Sub-opcode
contrl+12 contrl[6] handle
ptsin ptsin[0..7] src_clip_rect
ptsin+16 ptsin[8..15] src_rect
ptsin+32 ptsin[16..23] dst_rect
ptsout ptsout[0..7] clipped_src_rect
ptsout+16 ptsout[8..15] clipped_dst_rect
intout intout[0] Return value

7.11.15 vr_clip_rects_by_dst

Name: »Clip rectangles by destination rectangle«
Opcode: 171 (Sub-Opcode 0)
Syntax: int16_t vr_clip_rects_by_dst ( int16_t handle, RECT16 *dst_clip_rect, RECT16 *src_rect, RECT16 *dst_rect, RECT16 *clipped_src_rect, RECT16 *clipped_dst_rect );
Description: The call vr_clip_rects_by_ds cuts the destination rectangle with a clipping rectangle and adapts the source rectangle. The following apply:
Parameter Meaning
   
handle Workstation identifier
dst_clip_rect Clipping rectangle for destination (discrete coordinates, 16-bit)
src_rect Source rectangle (discrete coordinates, 16-bit)
dst_rect Destination rectangle (discrete coordinates, 16-bit)
clipped_src_rect Clipped source rectangle (discrete coordinates, 16-bit)
clipped_dst_rect Clipped destination rectangle (discrete coordinates, 16-bit)
Return value: 0: No clipping of the rectangles
1: All OK
Availability: As of NVDI 5.02.

If the driver offers the new clip functions, then bit 2 will be set in work_out[30] in the extended parameters of vq_extnd.
Group: Raster functions
See also: Binding

7.11.16 Bindings for vr_clip_rects_by_dst

C: int16_t vr_clip_rects_by_dst ( int16_t handle, RECT16 *dst_clip_rect, RECT16 *src_rect, RECT16 *dst_rect, RECT16 *clipped_src_rect, RECT16 *clipped_dst_rect );
Binding:
int16_t vr_clip_rects_by_dst ( int16_t handle,
                               RECT16 *dst_clip_rect,
                               RECT16 *src_rect,
                               RECT16 *dst_rect,
                               RECT16 *clipped_src_rect,
                               RECT16 *clipped_dst_rect )
{
   ptsin[0..3] = dst_clip_rect;
   ptsin[4..7] = src_rect;
   ptsin[8..11] = dst_rect;

   contrl[0] = 171;
   contrl[1] = 6;
   contrl[3] = 0;
   contrl[5] = 0;
   contrl[6] = handle;

   vdi ();

   clipped_src_rect = ptsout[0..3];
   clipped_dst_rect = ptsout[4..7];

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 171 # Function opcode
contrl+2 contrl[1] 6 # Entry in ptsin
contrl+4 contrl[2] 4 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 0 # Sub-opcode
contrl+12 contrl[6] handle
ptsin ptsin[0..3] dst_clip_rect
ptsin+8 ptsin[4..7] src_rect
ptsin+16 ptsin[8..11] dst_rect
ptsout ptsout[0..3] clipped_src_rect
ptsout+8 ptsout[4..7] clipped_dst_rect
intout intout[0] Return value

7.11.17 vr_clip_rects_by_src

Name: »Clip rectangles by source rectangle«
Opcode: 171 (Sub-Opcode 1)
Syntax: int16_t vr_clip_rects_by_src ( int16_t handle, RECT16 *src_clip_rect, RECT16 *src_rect, RECT16 *dst_rect, RECT16 *clipped_src_rect, RECT16 *clipped_dst_rect );
Description: The call vr_clip_rects_by_src cuts the source rectangle with a clipping rectangle (the function respects the rounding behaviour of vr_transfer_bits). The following apply:
Parameter Meaning
   
handle Workstation identifier
src_clip_rect Clipping rectangle for the source (discrete coordinates, 16-bit)
src_rect Source rectangle (discrete coordinates, 16-bit)
dst_rect Destination rectangle (discrete coordinates, 16-bit)
clipped_src_rect Clipped source rectangle (discrete coordinates, 16-bit)
clipped_dst_rect Clipped destination rectangle (discrete coordinates, 16-bit)
Return value: 0: No clipping of the rectangles
1: All OK
Availability: As of NVDI 5.02.

If the driver offers the new clip functions, then bit 2 will be set in work_out[30] in the extended parameters of vq_extnd.
Group: Raster functions
See also: Binding   vr_transfer_bits

7.11.18 Bindings for vr_clip_rects_by_src

C: int16_t vr_clip_rects_by_src ( int16_t handle, RECT16 *src_clip_rect, RECT16 *src_rect, RECT16 *dst_rect, RECT16 *clipped_src_rect, RECT16 *clipped_dst_rect );
Binding:
int16_t vr_clip_rects_by_src ( int16_t handle,
                               RECT16 *src_clip_rect,
                               RECT16 *src_rect,
                               RECT16 *dst_rect,
                               RECT16 *clipped_src_rect,
                               RECT16 *clipped_dst_rect )
{
   ptsin[0..3] = src_clip_rect;
   ptsin[4..7] = src_rect;
   ptsin[8..11] = dst_rect;

   contrl[0] = 171;
   contrl[1] = 6;
   contrl[3] = 0;
   contrl[5] = 1;
   contrl[6] = handle;

   vdi ();

   clipped_src_rect = ptsout[0..3];
   clipped_dst_rect = ptsout[4..7];

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 171 # Function opcode
contrl+2 contrl[1] 6 # Entry in ptsin
contrl+4 contrl[2] 4 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 1 # Sub-opcode
contrl+12 contrl[6] handle
ptsin ptsin[0..3] src_clip_rect
ptsin+8 ptsin[4..7] src_rect
ptsin+16 ptsin[8..11] dst_rect
ptsout ptsout[0..3] clipped_src_rect
ptsout+8 ptsout[4..7] clipped_dst_rect
intout intout[0] Return value

7.11.19 vr_transfer_bits

Name: »Transfer bitmap« - Combine two bitmaps.
Opcode: 170 (Sub-Opcode 0)
Syntax: void vr_transfer_bits( int16_t handle, GCBITMAP *src_bm, GCBITMAP *dst_bm, RECT16 *src_rect, RECT16 *dst_rect, int16_t mode );
Description: The call vr_transfer_bit combines two bitmaps, using scaling if required.
Parameter Meaning
   
handle Workstation identifier
src_bm Source bitmap
dst_bm Destination bitmap
src_rect Source rectangle
dst_rect Destination rectangle
mode Transfer function mode


The function vr_transfer_bit combines the source bitmapsrc_bm with the destination bitmap dst_bm, where mode specifies the transfer function. The source rectangle is passed in src_rect and the destination rectangle in dst_rect. The coordinates here are specified (as for all other VDI functions) as discrete values.

If the source and destination rectangles do not have the same size, vr_transfer_bit will scale the source bitmap. For reductions, the bitmap data will be interpolated if the source contains direct colour values (16 or 32 bit) or if the output takes place with dithering.

If the source and destination bitmaps do not have the same pixel format or the same colour depth, the source data is transformed automatically into the destination format (the source bitmap will remain unchanged, of course).

If src_bm or dst_bm is 0, then the bitmap of the workstation handle is used as source or destination of the operation respectively. For output to the screen a program should pass 0 for dst_bm in any case and not try to build up its own bitmap description. Clipping is applied only for the destination bitmap (and that only if the destination bitmap is the bitmap of the workstation).

Transfer modes

In the following list the constants for the transfer modes passed in mode are defined. In the comments the type of operation is specified in symbolic notation ('src' is the source pixel, 'dst' is the destination pixel, 'bg_col' is the pixel value of the background colour, 'hilite_col' is the pixel value of the colour used for emphasis):
/* Logical transfer modes */
#define T_LOGIC_COPY         0  /* dst = src;                      */
#define T_LOGIC_OR           1  /* dst = src OR dst;               */
#define T_LOGIC_XOR          2  /* dst = src XOR dst;              */
#define T_LOGIC_AND          3  /* dst = src AND dst;              */
#define T_LOGIC_NOT_COPY     4  /* dst = ( NOT src );              */
#define T_LOGIC_NOT_OR       5  /* dst = ( NOT src ) OR dst;       */
#define T_LOGIC_NOT_XOR      6  /* dst = ( NOT src ) XOR dst;      */
#define T_LOGIC_NOT_AND      7  /* dst = ( NOT src ) AND dst;      */

/* Drawing modes */
#define T_REPLACE            32 /* dst = src;                      */
#define T_TRANSPARENT        33 /* if ( src != bg_col ) dst = src; */
#define T_HILITE             34 /* if ( src != bg_col )            */
                                /* {                               */
                                /*    if ( dst == bg_col )         */
                                /*       dst = hilite_col;         */
                                /*    else if ( dst == hilite_col )*/
                                /*       dst = bg_col;             */
                                /* }                               */
#define T_REVERS_TRANSPARENT 35 /* if ( src == bg_col ) dst = src; */


Note: In the arithmetic transfer modes, source and destination are not combined according to their pixel values, but their (RGB) colour values are added or subtracted depending on their combination, ...

In the symbolic description below, 'RGB( x )' is the RGB colour value of a pixel and 'PIXELVALUE( rgb )' is the pixel value of a RGB colour value. 'MAX( rgb_a, rgb_b )' returns the maximum components of two RGB colour values; 'MIN( rgb_a, rgb_b )' similarly returns the minimum components. 'max_rgb' is a maximum RGB colour value, 'min_rgb' is a minimum RGB colour value. 'weighting' is a value between 0 and 1.0 which specifies the mixing of source and destination colours.
/* Arithmetic transfer modes */
#define T_BLEND     64 /* Mix source and destination colour */
                       /* rgb = RGB( src ) * weighting );   */
                       /* rgb += RGB( dst ) * (1-weighting));*/
                       /* dst = PIXELWERT( rgb );           */
#define T_ADD       65 /* Add source and destination colour */
                       /* rgb = RGB( src ) + RGB( dst )     */
                       /* if ( rgb > max_rgb )              */
                       /*    rgb = max_rgb;                 */
                       /* dst = PIXELWERT( rgb );           */
#define T_ADD_OVER  66 /* Add source and destination colour,*/
                       /* do not catch overflows            */
                       /* rgb = RGB( src ) + RGB( dst )     */
                       /* dst = PIXELWERT( rgb );           */
#define T_SUB       67 /* Subtract source from destination  */
                       /* colour                            */
                       /* rgb = RGB( dst ) - RGB( src )     */
                       /* if ( rgb < min_rgb )              */
                       /*    rgb = min_rgb;                 */
                       /* dst = PIXELWERT( rgb );           */
#define T_MAX       69 /* Maximum RGB components            */
                       /* rgb = MAX(RGB( dst ), RGB( src )) */
                       /* dst = PIXELWERT( rgb );           */
#define T_SUB_OVER  70 /* Subtract source from destination  */
                       /* colour, do not catch overflows    */
                       /* rgb = RGB( dst ) - RGB( src )     */
                       /* dst = PIXELWERT( rgb );           */
#define T_MIN       71 /* Minimum RGB components            */
                       /* rgb = MIN(RGB( dst ), RGB( src )) */
                       /* dst = PIXELWERT( rgb );           */


Furthermore, for all transfer modes one can affect the type of combination by the addition of one of the following constants:
#define T_COLORIZE     16    /* Colourize source   */
#define T_DITHER_MODE  128   /* Dither source data */


Dithering

'T_DITHER_MODE' leads to the use of an error-diffusion function if the destination bitmap has 256 or fewer colours (furthermore, interpolation will be performed for reductions in this case so that the details in the reduced image are not lost completely).

If the source and destination palette are equal (or the source palette is a subset of the system colour palette), NVDI (automatically) uses a faster transfer function internally without dithering.

Colourizing
  • If a logical mode is called with 'T_COLORIZE', the type of colourizing applied depends on the mode:

    T_LOGIC_COPY
    
    For all set bits in the colour value depict the
    background colour and for all cleared bits the
    foreground colour:
    rgb = (( NOT RGB( src )) & RGB( fg_col )) OR
          ( RGB( src ) AND RGB( bg_col ));
    dst = PIXELWERT( rgb );
    
    T_LOGIC_NOT_COPY
    
    For all set bits in the colour value depict the
    foreground colour and for all cleared bits the
    background colour:
    rgb = ( RGB( src ) & RGB( fg_col )) OR
          ((( NOT RGB( src )) AND RGB( bg_col ));
    dst = PIXELWERT( rgb );
    
    T_LOGIC_OR
    
    Everywhere that source bits are set, ( src AND
    fg_col ) will be depicted in the destination:
    dst = ( src AND fg_col ) OR (( NOT src ) AND dst );
    
    T_LOGIC_NOT_OR
    
    Everywhere that source bits are cleared,
    ((NOT src ) AND fg_col ) will be depicted in
    the destination:
    dst = (( NOT src ) AND fg_col ) OR ( src AND dst );
    
    T_LOGIC_XOR
    T_LOGIC_NOT_XOR
    
    The XOR combination ignores the colourizing.
    
    T_LOGIC_AND
    
    Everywhere that source bits are cleared,
    (( NOT src ) AND bg_col ) will be depicted in the
    destination:
    dst = ((NOT src ) AND bg_col ) OR ( src AND dst );
    
    T_LOGIC_NOT_AND
    
    Everywhere that source bits are set, ( src AND
    bg_col ) will be depicted in the destination:
    dst = ( src AND bg_col ) OR ((NOT src ) AND dst );
    

  • For the modes T_REPLACE, T_TRANSPARENT, T_HILITE and T_REVERS_TRANSPARENT the colourizing does not act in a binary manner on the colour or pixel values, but the colour values are scaled instead. The following sample shows how a colour value is colourized; 'bg_col', 'fg_col', 'src' and 'dst' are RGB colour values (between 0 and 65535):

    red_range = bg_col.red - fg_col.red;
    green_range = bg_col.green - fg_col.green;
    blue_range = bg_col.blue - fg_col.blue;
    
    dst.red = fg_col.red + ( src_color.red * red_range / 65535 );
    dst.green = fg_col.green + ( src_color.green * green_range / 65535 );
    dst.blue = fg_col.blue + ( src_color.blue * blue_range / 65535 );
    


    Note: At present, colourizing in the modes T_REPLACE, T_TRANSPARENT, T_HILITE and T_REVERS_TRANSPARENT is suppored only for source bitmaps with up to 256 colours. For source bitmaps with 16- or 32-bit depths there is at present no support for colourizing in these modes.

  • The arithmetic transfer modes do not support any colourizing.



Bitmaps

Instead of an antiquated MFDB, this function expects a GCBITMAP structure for describing the bitmaps.

If 'ctab' is 0L, the system colour table corresponding to the bit-depth will be used for the call (if the bitmap has more than 8 bits per pixel, i.e. uses direct colour values, 'ctab' can also be set to 0).

Source bitmaps do not require an inverse colour table; here 'itab' can be set to 0L. For a self-managed destination bitmap one must request a reference to an inverse colour table from the VDI (and at some later stage also release it again).

Simplified special cases

So that bitmaps in screen format can be copied in as uncomplicated a way as with vro_cpyfm without having to request a colour table and a reference to an inverse colour table, there are some simplified special cases for vr_transfer_bits:
  • If the source does not have a colour table (0L), the colour table of the device will be used if this has the same bit-depth. If this is not the case, the system colour table for the bit-depth of the source will be used.

  • If the destination does not have an (inverse) colour table, the (inverse) colour table of the device will be used if this has the same bit-depth. If this is not the case, the system colour table for the bitdepth of the destination will be used, and an additional inverse colour table will be built up internally for the call. This means that is is imperative that destination bitmaps that have no inverse colour table have the same bit-depth as the device belonging to the VDI handle.



Note: It is recommended that for bitmaps outside of the screen, v_open_bm or v_opnbm is used to create a bitmap by the VDI, so that one does not have to look after the management of colour tables and inverse colour tables in this case.

Pixel formats

To be able to convert bitmaps between various bitdepths and pixel formats, vr_transfer_bit requires a description of the pixel format, which is contained in the structure element 'px_format' of GCBITMAP. The build-up of this bit-vector is described in the following list; however, programmers may find the pre-defined formats to be of primary interest:
/* Constants for pixel formats */
#define  PX_1COMP    0x01000000L /* Pixel consists of one used component: Colour index */
#define  PX_3COMP    0x03000000L /* Pixel consists of three used components, e.g. RGB */
#define  PX_4COMP    0x04000000L /* Pixel consists of four used components, e.g. CMYK */
#define  PX_REVERSED 0x00800000L /* Pixel will be output in reverse byte order */
#define  PX_xFIRST   0x00400000L /* Unused bits lie before the used ones (viewed in Motorola format) */
#define  PX_kFIRST   0x00200000L /* K lies before CMY (viewed in Motorola format) */
#define  PX_aFIRST   0x00100000L /* Alpha channel lies before the colour bits (viewed in Motorola format) */
#define  PX_PACKED   0x00020000L /* Bits are stored sequentially */
#define  PX_PLANES   0x00010000L /* Bits are distributed over several planes (order: 0, 1, ..., n) */
#define  PX_IPLANES  0x00000000L /* Bits are distributed over several words (order: 0, 1, ..., n) */
#define  PX_USES1    0x00000100L /* 1 bit of the pixel is used */
#define  PX_USES2    0x00000200L /* 2 bits of the pixel are used */
#define  PX_USES3    0x00000300L /* 3 bits of the pixel are used */
#define  PX_USES4    0x00000400L /* 4 bits of the pixel are used */
#define  PX_USES8    0x00000800L /* 8 bits of the pixel are used */
#define  PX_USES15   0x00000f00L /* 15 bits of the pixel are used */
#define  PX_USES16   0x00001000L /* 16 bits of the pixel are used */
#define  PX_USES24   0x00001800L /* 24 bits of the pixel are used */
#define  PX_USES32   0x00002000L /* 32 bits of the pixel are used */
#define  PX_USES48   0x00003000L /* 48 bits of the pixel are used */
#define  PX_1BIT     0x00000001L /* Pixel consists of 1 bit */
#define  PX_2BIT     0x00000002L /* Pixel consists of 2 bits */
#define  PX_3BIT     0x00000003L /* Pixel consists of 3 bits */
#define  PX_4BIT     0x00000004L /* Pixel consists of 4 bits */
#define  PX_8BIT     0x00000008L /* Pixel consists of 8 bits */
#define  PX_16BIT    0x00000010L /* Pixel consists of 16 bits */
#define  PX_24BIT    0x00000018L /* Pixel consists of 24 bits */
#define  PX_32BIT    0x00000020L /* Pixel consists of 32 bits */
#define  PX_48BIT    0x00000030L /* Pixel consists of 48 bits */
#define  PX_CMPNTS   0x0f000000L /* Mask for number of pixel components */
#define  PX_FLAGS    0x00f00000L /* Mask for various flags */
#define  PX_PACKING  0x00030000L /* Mask for pixel format */
#define  PX_USED     0x00003f00L /* Mask for number of used bits */
#define  PX_BITS     0x0000003fL /* Mask for number of bits per pixel */
/* Pixel formats for ATARI graphics */
#define  PX_ATARI1  ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
#define  PX_ATARI2  ( PX_IPLANES + PX_1COMP + PX_USES2 + PX_2BIT )
#define  PX_ATARI4  ( PX_IPLANES + PX_1COMP + PX_USES4 + PX_4BIT )
#define  PX_ATARI8  ( PX_IPLANES + PX_1COMP + PX_USES8 + PX_8BIT )
#define  PX_FALCON15( PX_PACKED + PX_3COMP + PX_USES16 + PX_16BIT )
/* Pixel formats for Mac */
#define  PX_MAC1    ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
#define  PX_MAC4    ( PX_PACKED + PX_1COMP + PX_USES4 + PX_4BIT )
#define  PX_MAC8    ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
#define  PX_MAC15   ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES15 + PX_16BIT )
#define  PX_MAC32   ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
/* Pixel formats for graphics cards */
#define  PX_VGA1    ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
#define  PX_VGA4    ( PX_PLANES + PX_1COMP + PX_USES4 + PX_4BIT )
#define  PX_VGA8    ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
#define  PX_VGA15   ( PX_REVERSED + PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES15 + PX_16BIT )
#define  PX_VGA16   ( PX_REVERSED + PX_PACKED + PX_3COMP + PX_USES16 + PX_16BIT )
#define  PX_VGA24   ( PX_REVERSED + PX_PACKED + PX_3COMP + PX_USES24 + PX_24BIT )
#define  PX_VGA32   ( PX_REVERSED + PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
#define  PX_MATRIX16( PX_PACKED + PX_3COMP + PX_USES16 + PX_16BIT )
#define  PX_NOVA32  ( PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
/* Pixel formats for printers */
#define  PX_PRN1    ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
#define  PX_PRN8    ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
#define  PX_PRN32   ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )
/* Preferred (fast) pixel formats for bitmaps */
#define  PX_PREF1   ( PX_PACKED + PX_1COMP + PX_USES1 + PX_1BIT )
#define  PX_PREF2   ( PX_PACKED + PX_1COMP + PX_USES2 + PX_2BIT )
#define  PX_PREF4   ( PX_PACKED + PX_1COMP + PX_USES4 + PX_4BIT )
#define  PX_PREF8   ( PX_PACKED + PX_1COMP + PX_USES8 + PX_8BIT )
#define  PX_PREF15  ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES15 + PX_16BIT )
#define  PX_PREF32  ( PX_xFIRST + PX_PACKED + PX_3COMP + PX_USES24 + PX_32BIT )!end_verbatim


For programs that create (or load) bitmaps themselves and want to output them to the screen afterwards, the last-named formats PX_PREFx are specially recommended, as - if the screen uses a different pixel format - they can be converted with less effort than some of the other formats.
Return value: The function does not return a result.
Availability: As of NVDI 5.00.

If the driver offers the new rasterizing functions, then bit 1 will be set in work_out[30] in the extended parameters of vq_extnd.
Group: Raster functions
See also: Binding

7.11.20 Bindings for vr_transfer_bits

C: void vr_transfer_bits( int16_t handle, GCBITMAP *src_bm, GCBITMAP *dst_bm, RECT16 *src_rect, RECT16 *dst_rect, int16_t mode );
Binding:
void vr_transfer_bits( int16_t handle, GCBITMAP *src_bm,
                       GCBITMAP *dst_bm, RECT16 *src_rect,
                       RECT16 *dst_rect, int16_t mode )
{
   intin[o] = mode;
   intin[1] = 0;
   intin[2] = 0;
   intin[3] = 0;

   ptsin[0..3] = src_rect;
   ptsin[4..7] = dst_rect;

   contrl[0] = 170;
   contrl[1] = 4;
   contrl[3] = 4;
   contrl[5] = 0;
   contrl[6] = handle;
   contrl[7..8] = src_bm;
   contrl[9..10] = dst_bm;
   contrl[11..12] = 0;

   vdi ();
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 170 # Function opcode
contrl+2 contrl[1] 4 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 4 # Entry in intin
contrl+8 contrl[4] 0 # Entry in intout
contrl+10 contrl[5] 0 # Sub-opcode
contrl+12 contrl[6] handle
contrl+14 contrl[7..8] src_bm
contrl+18 contrl[9..10] dst_bm
contrl+22 contrl[11..12] 0
intin intin[0] mode
intin+2 intin[1] 0
intin+4 intin[2] 0
ptsin ptsin[0..3] src_rect
ptsin+8 ptsin[4..7] dst_rect

7.11.21 vr_trnfm

Name: »Transform form« - Transform a raster image memory
Opcode: 110
Syntax: void vr_trnfm ( int16_t handle, MFDB *psrcMFDB, MFDB *pdesMFDB );
Description: The call vr_trnf transforms a raster image memory block from standard format to a device-dependent format and vice versa. The following apply:
Parameter Meaning
   
handle Workstation identifier
psrcMFDB Pointer to the source MFDB
pdesMFDB Pointer to the destination MFDB


The standard format mentioned above is a platformindependent data format, which can therefore be used for interchanging data between various GEM systems.

Notes: One can relieve the VDI of a lot of work by specifying different raster addresses for source and destination MFDBs; otherwise an in-place transform may well take several minutes for a large form.
Return value: The function does not return a result.
Availability: Supported by all drivers.
Group: Raster functions
See also: Binding   vro_cpyfm   vrt_cpyfm   Raster formats

7.11.22 Bindings for vr_trnfm

C: void vr_trnfm ( int16_t handle, MFDB *psrcMFDB, MFDB *pdesMFDB );
Binding:
void vr_trnfm (int16_t handle, MFDB *psrcMFDB, MFDB *pdesMFDB)
{
   iptr (psrcMFDB);
   iptr_2 (pdesMFDB);

   contrl[0] = 110;
   contrl[1] = 0;
   contrl[3] = 0;
   contrl[6] = handle;

   vdi ();
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 110 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 0 # Entry in intin
contrl+8 contrl[4] 0 # Entry in intout
contrl+12 contrl[6] handle
contrl+14 contrl[7,8] psrcMFDB
contrl+18 contrl[9,10] pdesMFDB

7.11.23 vro_cpyfm

Name: »Copy raster, opaque« - Copy a memory block.
Opcode: 109
Syntax: void vro_cpyfm ( int16_t handle, int16_t vr_mode, int16_t *pxyarray, MFDB *psrcMFDB, MFDB *pdesMFDB );
Description: The call vro_cpyfm copies a source memory block to a destination and during this combines the source S and destination D by the logical linkage decoded in vr_mode. The following apply:
Parameter Meaning
   
handle Workstation identifier
vr_mode One of 16 logical operations between the pixels of source and destination rasters:
ALL_WHITE 0 D := 0
S_AND_D 1 D := S AND D
S_AND_NOTD 2 D := S AND (NOT D)
S_ONLY 3 D := S
NOTS_AND_D 4 D := (NOT S) AND D
D_ONLY 5 D := D
S_XOR_D 6 D := S XOR D
S_OR_D 7 D := S OR D
NOT_SORD 8 D := NOT (S OR D)
NOT_SXORD 9 D := NOT (S XOR D)
D_INVERT 10 D := NOT D
NOT_D 11 D := S OR (NOT D)
S_OR_NOTD 12 D := NOT S
NOTS_OR_D 13 D := (NOT S) OR D
NOT_SANDD 14 D := NOT (S AND D)
ALL_BLACK 15 D := 1
pxyarray[0] X-coordinate, and
pxyarray[1] Y-coordinate of a corner of the source rectangle
pxyarray[2] X-coordinate, and
pxyarray[3] Y-coordinate of the diagonally opposite corner of the source rectangle
pxyarray[4] X-coordinate, and
pxyarray[5] Y-coordinate of a corner of the destination rectangle
pxyarray[6] X-coordinate, and
pxyarray[7] Y-coordinate of the diagonally opposite corner of the destination rectangle
psrcMFDB Pointer to the source MFDB
pdesMFDB Pointer to the destination MFDB


Note: If the sizes of both rasters do not match, then the size of the source raster will be used. The address of the destination raster in that case serves only as a pointer. If the addresses of the source and destination areas correspond (and if they are non-zero) and if the two areas overlap, then the source rectangle will not be altered until the destination rectangle has been copied.

vro_cpyfm usually ignores the height and width of the destination rectangle and uses the size of the source. If you want to scale a bitmap, you have to set the most significant bit in the transfer mode (vr_mode | 0x8000). In this case vro_cpyfm scales the bitmap according to the size of the destination rectangle. Whether the driver is able to scale or not is returned by vq_extnd in work_out[30] (you are only allowed to set the upper bit of the mode if it is able to).

Important: Rasters in standard format cannot and must not be copied, as in general one has no information about the device-specific format. Hence the function vr_trnfm should be used if necessary.

Note re NVDI: In some older printer drivers this function unfortunately has an error, which results in bitmaps that are only a line high possibly not being output. For this reason the passed bitmap should be at least two lines high.
Return value: The function does not return a result.
Availability: Supported by all screen drivers.
Group: Raster functions
See also: Binding   vrt_cpyfm   vr_trnfm   Raster formats

7.11.24 Bindings for vro_cpyfm

C: void vro_cpyfm ( int16_t handle, int16_t vr_mode, int16_t *pxyarray, MFDB *psrcMFDB, MFDB *pdesMFDB );
Binding:
void vro_cpyfm (int16_t handle, int16_t vr_mode,
                int16_t *pxyarray, MFDB *psrcMFDB,
                MFDB *pdesMFDB)
{
   intin[0]    = vr_mode;
   ptsin[0..7] = pxyarray[0..7];
   iptr (psrcMFDB);
   iptr2 (pdesMFDB);

   contrl[0] = 109;
   contrl[1] = 4;
   contrl[3] = 1;
   contrl[6] = handle;

   vdi ();
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 109 # Function opcode
contrl+2 contrl[1] 4 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 1 # Entry in intin
contrl+8 contrl[4] 0 # Entry in intout
contrl+12 contrl[6] handle
contrl+14 contrl[7,8] psrcMFDB
contrl+18 contrl[9,10] pdesMFDB
intin intin[0] vr_mode
ptsin ptsin[0..7] pxyarray[0..7]

7.11.25 vrt_cpyfm

Name: »Copy raster, transparent« - Copy a monochrome raster onto a colour raster.
Opcode: 121
Syntax: void vrt_cpyfm ( int16_t handle, int16_t vr_mode, int16_t *pxyarray, MFDB *psrcMFDB, MFDB *pdesMFDB, int16_t *color_index );
Description: The call vrt_cpyfm copies a monochrome, rectangular raster onto another (possibly coloured) raster, paying respect to the writing modes. The following apply:
Parameter Meaning
   
handle Workstation identifier
vr_mode Writing mode:
1 = Replace
2 = Transparent
3 = XOR
4 = Reverse Transparent
pxyarray[0] X-coordinate, and
pxyarray[1] Y-coordinate of a corner of the source rectangle
pxyarray[2] X-coordinate, and
pxyarray[3] Y-coordinate of diagonally opposite corner of the source rectangle
pxyarray[4] X-coordinate, and
pxyarray[5] Y-coordinate of a corner of the destination rectangle
pxyarray[6] X-coordinate, and
pxyarray[7] Y-coordinate of diagonally opposite corner of the destination rectangle
psrcMFDB Pointer to the source MFDB
pdesMFDB Pointer to the destination MFDB
color_index[0] Colour index of the colour which is to be interpreted as set
color_index[1] Colour index of the colour which is to be interpreted as cleared (not set)


Note: Should the dimensions of the rasters not match, then the size of the source raster and the upper left corner of the destination raster will be used as a starting point. The screen may never be specified as the source raster.

Usually vrt_cpyfm ignores the height and width of the destination rectangle and uses the size of the source. If you want to scale a bitmap, you have to set the most significant bit in the transfer mode (vr_mode | 0x8000). In this case vrt_cpyfm scales the bitmap according to the size of the destination rectangle. Whether the driver is able to scale or not is returned by vq_extnd in work_out[30] (you are only allowed to set the upper bit of the mode if it is able to).

Warning: In some older NVDI printer drivers this function unfortunately has an error, which results in bitmaps that are only a line high possibly not being output. For this reason the passed bitmap should be at least two lines high.
Return value: The function does not return a result.
Availability: Supported by all screen drivers.
Group: Raster functions
See also: Binding   vro_cpyfm   vswr_mode   Raster formats

7.11.26 Bindings for vrt_cpyfm

C: void vrt_cpyfm ( int16_t handle, int16_t vr_mode, int16_t *pxyarray, MFDB *psrcMFDB, MFDB *pdesMFDB, int16_t *color_index );
Binding:
void vrt_cpyfm (int16_t handle, int16_t vr_mode,
                int16_t *pxyarray,MFDB *psrcMFDB,
                MFDB *pdesMFDB, int16_t *color_index)
{
   intin[0]    = vr_mode;
   intin[1]    = *color_index++;
   intin[2]    = *color_index;
   ptsin[0..7] = pxyarray[0..7];

   iptr (psrcMFDB);
   iptr_2 (pdesMFDB);

   contrl[0] = 121;
   contrl[1] = 4;
   contrl[3] = 3;
   contrl[6] = handle;

   vdi ();
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 121 # Function opcode
contrl+2 contrl[1] 4 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 3 # Entry in intin
contrl+8 contrl[4] 0 # Entry in intout
contrl+12 contrl[6] handle
contrl+14 contrl[7,8] psrcMFDB
contrl+18 contrl[9,10] pdesMFDB
intin intin[0] vr_mode
intin+2 intin[1..2] color_index[0..1]
ptsin ptsin[0..7] pxyarray[0..7]

7.11.27 vs_hilite_color

Name: »Set hilite colour« - Set the highlighting colour.
Opcode: 207 (Sub-Opcode 0)
Syntax: int16_t vs_hilite_color( int16_t handle, int32_t color_space, COLOR_ENTRY *hilite_color );
Description: The call vs_hilite_color sets the highlighting colour. The following apply:
Parameter Meaning
   
handle Workstation identifier
color_space Colour space (at present only 0 for the colour space set, or CSPACE_RGB)
hilite_color COLOR_ENTRY of the highlighting colour
Return value: -1 = Wrong subfunction number
 0 = Function not present
 1 = All OK
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.28 Bindings for vs_hilite_color

C: int16_t vs_hilite_color( int16_t handle, int32_t color_space, COLOR_ENTRY *hilite_color );
Binding:
int16_t vs_hilite_color( int16_t handle, int32_t color_space,
                         COLOR_ENTRY *hilite_color )
{
   intin[0..1]    = color_space;
   intin[2..5]    = hilite_color;

   contrl[0] = 207;
   contrl[1] = 0;
   contrl[3] = 6;
   contrl[5] = 0;
   contrl[6] = handle;

   vdi ();

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 207 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 6 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 0 # Sub-opcode
contrl+12 contrl[6] handle
intin intin[0..1] color_space
intin+4 intin[2..5] hilite_color
intout intout[0] Return value

7.11.29 vs_max_color

Name: »Set maximum colour« - Set maximum colour value for a additive raster operation.
Opcode: 207 (Sub-Opcode 2)
Syntax: int16_t vs_max_color( int16_t handle, int32_t color_space, COLOR_ENTRY *max_color );
Description: The call vs_max_color sets the maximum colour value for an additive raster operation. The following apply:
Parameter Meaning
   
handle Workstation identifier
color_space Colour space (at present only 0 for the colour space set, or CSPACE_RGB)
max_color COLOR_ENTRY of the maximum colour value for T_SUB
Return value: -1 = Wrong subfunction number
 0 = Function not present
 1 = All OK
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.30 Bindings for vs_max_color

C: int16_t vs_max_color( int16_t handle, int32_t color_space, COLOR_ENTRY *max_color );
Binding:
int16_t vs_max_color( int16_t handle, int32_t color_space,
                      COLOR_ENTRY *max_color )
{
   intin[0..1]    = color_space;
   intin[2..5]    = max_color;

   contrl[0] = 207;
   contrl[1] = 0;
   contrl[3] = 6;
   contrl[5] = 2;
   contrl[6] = handle;

   vdi ();

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 207 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 6 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 2 # Sub-opcode
contrl+12 contrl[6] handle
intin intin[0..1] color_space
intin+4 intin[2..5] max_color
intout intout[0] Return value

7.11.31 vs_min_color

Name: »Set minimum colour« - Set minimum colour value for a subtractive raster operation.
Opcode: 207 (Sub-Opcode 1)
Syntax: int16_t vs_min_color( int16_t handle, int32_t color_space, COLOR_ENTRY *min_color );
Description: The call vs_min_color sets the minimum colour value for a subtractive raster operation. The following apply:
Parameter Meaning
   
handle Workstation identifier
color_space Colour space (at present only 0 for the colour space set, or CSPACE_RGB)
min_color COLOR_ENTRY of the minimum colour value for T_SUB
Return value: -1 = Wrong subfunction number
 0 = Function not present
 1 = All OK
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.32 Bindings for vs_min_color

C: int16_t vs_min_color( int16_t handle, int32_t color_space, COLOR_ENTRY *min_color );
Binding:
int16_t vs_min_color( int16_t handle, int32_t color_space,
                      COLOR_ENTRY *min_color )
{
   intin[0..1]    = color_space;
   intin[2..5]    = min_color;

   contrl[0] = 207;
   contrl[1] = 0;
   contrl[3] = 6;
   contrl[5] = 1;
   contrl[6] = handle;

   vdi ();

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 207 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 6 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 1 # Sub-opcode
contrl+12 contrl[6] handle
intin intin[0..1] color_space
intin+4 intin[2..5] min_color
intout intout[0] Return value

7.11.33 vs_weight_color

Name: »Set weight colour« - Set weighting for blend function.
Opcode: 207 (Sub-Opcode 3)
Syntax: int16_t vs_weight_color( int16_t handle, int32_t color_space, COLOR_ENTRY *weight_color );
Description: The call vs_weight_color sets the weighting for the colour blend function. The following apply:
Parameter Meaning
   
handle Workstation identifier
color_space Colour space (at present only 0 for the colour space set, or CSPACE_RGB)
weight_color COLOR_ENTRY of the weighting for T_SUB
Return value: -1 = Wrong subfunction number
 0 = Function not present
 1 = All OK
Availability: As of NVDI 5.00.
Group: Raster functions
See also: Binding

7.11.34 Bindings for vs_weight_color

C: int16_t vs_weight_color( int16_t handle, int32_t color_space, COLOR_ENTRY *weight_color );
Binding:
int16_t vs_weight_color( int16_t handle, int32_t color_space,
                         COLOR_ENTRY *weight_color )
{
   intin[0..1]    = color_space;
   intin[2..5]    = weight_color;

   contrl[0] = 207;
   contrl[1] = 0;
   contrl[3] = 6;
   contrl[5] = 3;
   contrl[6] = handle;

   vdi ();

   return ( intout[0] );
}
GEM-Arrays:

Address Element Contents
contrl contrl[0] 207 # Function opcode
contrl+2 contrl[1] 0 # Entry in ptsin
contrl+4 contrl[2] 0 # Entry in ptsout
contrl+6 contrl[3] 6 # Entry in intin
contrl+8 contrl[4] 1 # Entry in intout
contrl+10 contrl[5] 3 # Sub-opcode
contrl+12 contrl[6] handle
intin intin[0..1] color_space
intin+4 intin[2..5] weight_color
intout intout[0] Return value

HomeVDIControl functionsVDI functions list