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
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:
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
|
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: |
|
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:
| ||||||||
Return value: | Colour space set.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Raster functions
| ||||||||
See also: | Binding
|
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: |
|
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.
| ||||||||
Return value: | Colour space set.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Raster functions
| ||||||||
See also: | Binding
|
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: |
|
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).
| ||||||||
Return value: | Colour space set.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Raster functions
| ||||||||
See also: | Binding
|
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: |
|
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).
| ||||||||
Return value: | Colour space set.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Raster functions
| ||||||||
See also: | Binding
|
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: |
|
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.
| ||||||||||||||||
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
|
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: |
|
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:
| ||||||||||||||||
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
|
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: |
|
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:
| ||||||||||||||||
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
|
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: |
|
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:
| ||||||||||||||||
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
|
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: |
|
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.
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 */ /* dst = src; */ #define T_LOGIC_COPY 0 /* dst = src OR dst; */ #define T_LOGIC_OR 1 /* dst = src XOR dst; */ #define T_LOGIC_XOR 2 /* dst = src AND dst; */ #define T_LOGIC_AND 3 /* dst = ( NOT src ); */ #define T_LOGIC_NOT_COPY 4 /* dst = ( NOT src ) OR dst; */ #define T_LOGIC_NOT_OR 5 /* dst = ( NOT src ) XOR dst; */ #define T_LOGIC_NOT_XOR 6 /* dst = ( NOT src ) AND dst; */ #define T_LOGIC_NOT_AND 7 /* Drawing modes */ /* dst = src; */ #define T_REPLACE 32 /* if ( src != bg_col ) dst = src; */ #define T_TRANSPARENT 33 /* if ( src != bg_col ) */ /* { */ /* if ( dst == bg_col ) */ /* dst = hilite_col; */ /* else if ( dst == hilite_col )*/ /* dst = bg_col; */ /* } */ #define T_HILITE 34 /* if ( src == bg_col ) dst = src; */ #define T_REVERS_TRANSPARENT 35 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 */ /* Mix source and destination color */ /* rgb = RGB( src ) * weighting ); */ /* rgb += RGB( dst ) * (1-weighting));*/ /* dst = PIXELWERT( rgb ); */ #define T_BLEND 64 /* Add source and destination color */ /* rgb = RGB( src ) + RGB( dst ) */ /* if ( rgb > max_rgb ) */ /* rgb = max_rgb; */ /* dst = PIXELWERT( rgb ); */ #define T_ADD 65 /* Add source and destination color, */ /* do not catch overflows */ /* rgb = RGB( src ) + RGB( dst ) */ /* dst = PIXELWERT( rgb ); */ #define T_ADD_OVER 66 /* Subtract source from destination */ /* color */ /* rgb = RGB( dst ) - RGB( src ) */ /* if ( rgb < min_rgb ) */ /* rgb = min_rgb; */ /* dst = PIXELWERT( rgb ); */ #define T_SUB 67 /* Maximum RGB components */ /* rgb = MAX(RGB( dst ), RGB( src )) */ /* dst = PIXELWERT( rgb ); */ #define T_MAX 69 /* Subtract source from destination */ /* color, do not catch overflows */ /* rgb = RGB( dst ) - RGB( src ) */ /* dst = PIXELWERT( rgb ); */ #define T_SUB_OVER 70 /* Minimum RGB components */ /* rgb = MIN(RGB( dst ), RGB( src )) */ /* dst = PIXELWERT( rgb ); */ #define T_MIN 71 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
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:
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 bit depths 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 */ /* Pixel consists of one used component: Color index */ #define PX_1COMP 0x01000000L /* Pixel consists of three used components, e.g. RGB */ #define PX_3COMP 0x03000000L /* Pixel consists of four used components, e.g. CMYK */ #define PX_4COMP 0x04000000L /* Pixel will be output in reverse byte order */ #define PX_REVERSED 0x00800000L /* Unused bits lie before the used ones (viewed in Motorola format) */ #define PX_xFIRST 0x00400000L /* K lies before CMY (viewed in Motorola format) */ #define PX_kFIRST 0x00200000L /* Alpha channel lies before the color bits (viewed in Motorola format) */ #define PX_aFIRST 0x00100000L /* Bits are stored sequentially */ #define PX_PACKED 0x00020000L /* Bits are distributed over several planes (order: 0, 1, ..., n) */ #define PX_PLANES 0x00010000L /* Bits are distributed over several words (order: 0, 1, ..., n) */ #define PX_IPLANES 0x00000000L /* 1 bit of the pixel is used */ #define PX_USES1 0x00000100L /* 2 bits of the pixel are used */ #define PX_USES2 0x00000200L /* 3 bits of the pixel are used */ #define PX_USES3 0x00000300L /* 4 bits of the pixel are used */ #define PX_USES4 0x00000400L /* 8 bits of the pixel are used */ #define PX_USES8 0x00000800L /* 15 bits of the pixel are used */ #define PX_USES15 0x00000f00L /* 16 bits of the pixel are used */ #define PX_USES16 0x00001000L /* 24 bits of the pixel are used */ #define PX_USES24 0x00001800L /* 32 bits of the pixel are used */ #define PX_USES32 0x00002000L /* 48 bits of the pixel are used */ #define PX_USES48 0x00003000L /* Pixel consists of 1 bit */ #define PX_1BIT 0x00000001L /* Pixel consists of 2 bits */ #define PX_2BIT 0x00000002L /* Pixel consists of 3 bits */ #define PX_3BIT 0x00000003L /* Pixel consists of 4 bits */ #define PX_4BIT 0x00000004L /* Pixel consists of 8 bits */ #define PX_8BIT 0x00000008L /* Pixel consists of 16 bits */ #define PX_16BIT 0x00000010L /* Pixel consists of 24 bits */ #define PX_24BIT 0x00000018L /* Pixel consists of 32 bits */ #define PX_32BIT 0x00000020L /* Pixel consists of 48 bits */ #define PX_48BIT 0x00000030L /* Mask for number of pixel components */ #define PX_CMPNTS 0x0f000000L /* Mask for various flags */ #define PX_FLAGS 0x00f00000L /* Mask for pixel format */ #define PX_PACKING 0x00030000L /* Mask for number of used bits */ #define PX_USED 0x00003f00L /* Mask for number of bits per pixel */ #define PX_BITS 0x0000003fL /* 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 ) 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
|
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: |
|
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:
The standard format mentioned above is a platform-independent 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
|
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: |
|
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:
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 for 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. Note for TC-VDI: vr_mode from 16 to 27 are supported only by MATRIX graphic boards. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
|
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: |
|
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:
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. Note for TC-VDI: TC-VDI has two new modes: 1 - Copy multi color raster to screen Copy psrcMFDB (8bpp, packed pixels) to pdesMFDB (8 or 32bpp, device-specific format). Convert VDI color numbers to pixel values, in 32bpp expand pixel through the software palette. Valid modes are: REPLACE, color_index is not used, and TRANSPARENT, color_index[0] is the transparent color (source pixels with this color are not copied, destination is unchanged). Others modes have no action. 2 - Expand packed 24bpp raster to screen Copy psrcMFDB (24bpp, packed pixels) to pdesMFDB (32bpp, device-specific format). Expand 24bpp source to 32bpp destination. Valid mode is REPLACE, color_index is not used. Others modes have no action. | ||||||||||||||||||||||||||||||||||||||||
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
|
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: |
|
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:
| ||||||||||
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
|
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: |
|
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:
| ||||||||||
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
|
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: |
|
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:
| ||||||||||
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
|
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: |
|
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:
| ||||||||||
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
|
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: |
|