• v_color2nearest | Inquires nearest colour value |
• v_color2value | Translates colour value to pixel value |
• v_create_ctab | Creates colour table |
• v_create_itab | Creates inverse colour table reference |
• v_ctab_idx2value | Inquires colour table value |
• v_ctab_idx2vdi | Translates colour table index to VDI index |
• v_ctab_vdi2idx | Translates VDI colour index to colour table index |
• v_delete_ctab | Deletes colour table |
• v_delete_itab | Deletes inverse colour table reference |
• v_get_ctab_id | Gets unique ID for a new colour table |
• v_value2color | Translates pixel value to colour entry |
• vq_ctab | Inquires current colour table |
• vq_ctab_entry | Inquires colour table entry |
• vq_ctab_id | Inquires current colour table ID |
• vq_dflt_ctab | Inquires default (system) colour table |
• vq_px_format | Inquires pixel format and colour space |
• vs_ctab | Sets colour table |
• vs_ctab_entry | Sets colour value in the colour table |
• vs_dflt_ctab | Sets defaut (system) colour table |
See also: VDI workstations Style guidelines
Name: | »Inquire Nearest Color Entry«
| ||||||||||||
Opcode: | 204 (Sub-Opcode 2)
| ||||||||||||
Syntax: | int32_t v_color2nearest( int16_t handle, int32_t color_space,
COLOR_ENTRY *color, COLOR_ENTRY *nearest_color );
| ||||||||||||
Description: | The call v_color2nearest returns the nearest colour value for
the desired COLOR_ENTRY.
| ||||||||||||
Return value: | The function returns the colour value and the colour space of
the nearest colour.
| ||||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||||
Group: | Colour table functions
| ||||||||||||
See also: | Binding
|
C: | int32_t v_color2nearest( int16_t handle, int32_t color_space,
COLOR_ENTRY *color, COLOR_ENTRY *nearest_color );
| ||||||||||||||||||||||||||||||||||||
Binding: |
int32_t v_color2nearest( int16_t handle, int32_t color_space, COLOR_ENTRY *color, COLOR_ENTRY *nearest_color ) { intin[0..1] = color_space; intin[2..5] = color; contrl[0] = 204; contrl[1] = 0; contrl[3] = 6; contrl[5] = 2; contrl[6] = handle; vdi (); nearest_color = intout[2..5]; return ( (int32_t) intout[0] ); } | ||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Translate colour entry to pixel value«
| ||||||||||
Opcode: | 204 (Sub-Opcode 0)
| ||||||||||
Syntax: | uint32_t v_color2value( int16_t handle, int32_t color_space,
COLOR_ENTRY *color );
| ||||||||||
Description: | The call v_color2value returns a colour value for a pixel value.
| ||||||||||
Return value: | The pixel value.
| ||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||
Group: | Colour table functions
| ||||||||||
See also: | Binding
|
C: | uint32_t v_color2value( int16_t handle, int32_t color_space,
COLOR_ENTRY *color );
| |||||||||||||||||||||||||||||||||
Binding: |
uint32_t v_color2value( int16_t handle, int32_t color_space, COLOR_ENTRY *color ) { intin[0..1] = color_space; intin[2..5] = color; contrl[0] = 204; contrl[1] = 0; contrl[3] = 6; contrl[5] = 0; contrl[6] = handle; vdi (); return ( (uint32_t) intout[0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Create colour table«
| ||||||||||
Opcode: | 206 (Sub-Opcode 8)
| ||||||||||
Syntax: | COLOR_TAB *v_create_ctab( int16_t handle, int32_t color_space,
uint32_t px_format );
| ||||||||||
Description: | The call v_create_ctab creates a colour table in the colour
space color_space for a bitmap with px_format &
PX_BITS bits. The colour table is initialized with the standard
colours for this bit-depth. The application can write to the colour
table and alter the colour entries; however if the colours are
altered, one has to obtain a new ID by calling rev_get_ctab_id and
enter this in the structure element <map_id>. Otherwise false
colours will be output.
After use the colour table can be cleared with v_delete_ctab.
| ||||||||||
Return value: | The function returns a pointer to the colour table.
| ||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||
Group: | Colour table functions
| ||||||||||
See also: | Binding
|
C: | COLOR_TAB *v_create_ctab( int16_t handle, int32_t color_space,
uint32_t px_format );
| |||||||||||||||||||||||||||||||||
Binding: |
COLOR_TAB *v_create_ctab( int16_t handle, int32_t color_space, uint32_t px_format ) { intin[0..1] = color_space; intin[2..3] = px_format; contrl[0] = 206; contrl[1] = 0; contrl[3] = 4; contrl[5] = 8; contrl[6] = handle; vdi (); return ( (uint32_t) intout[0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Create inverse colour table reference«
| ||||||||||
Opcode: | 208 (Sub-Opcode 0)
| ||||||||||
Syntax: | ITAB_REF v_create_itab( int16_t handle, COLOR_TAB *ctab,
int16_t bits );
| ||||||||||
Description: | The call v_create_itab creates an inverse colour table of the
colour table passsed to it and returns a reference to it. Programs
need to call this function only if they themselves manage bitmaps that
are the destination of a vr_transfer_bits operation (if the off-screen
bitmap is created by the VDI, i.e with v_opnbm or v_open_bm, the
VDI does this automatically). See also the description of
vr_transfer_bits.
| ||||||||||
Return value: | The function returns the reference to the inverse colour table.
| ||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||
Group: | Colour table functions
| ||||||||||
See also: | Binding
|
C: | ITAB_REF v_create_itab( int16_t handle, COLOR_TAB *ctab,
int16_t bits );
| |||||||||||||||||||||||||||||||||||||||
Binding: |
ITAB_REF v_create_itab( int16_t handle, COLOR_TAB *ctab, int16_t bits ) { intin[0..1] = ctab; intin[2] = bits; intin[3] = 0; intin[4] = 0; contrl[0] = 208; contrl[1] = 0; contrl[3] = 5; contrl[5] = 0; contrl[6] = handle; vdi (); return ( (uint32_t) intout[0] ); } | |||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Inquire colour table value« - Return pixel value.
| ||||||||
Opcode: | 206 (Sub-Opcode 5)
| ||||||||
Syntax: | uint32_t v_ctab_idx2value( int16_t handle, int16_t index );
| ||||||||
Description: | The call v_ctab_idx2value returns the pixel value for an entry in
the colour table. If the passed index is larger than the
number of colour pens, then the pixel value of the colour black will
be returned.
| ||||||||
Return value: | The function returns the pixel value.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Colour table functions
| ||||||||
See also: | Binding
|
C: | uint32_t v_ctab_idx2value( int16_t handle, int16_t index );
| ||||||||||||||||||||||||||||||
Binding: |
uint32_t v_ctab_idx2value( int16_t handle, int16_t index ) { intin[0] = index; contrl[0] = 206 contrl[1] = 0; contrl[3] = 1; contrl[5] = 5; contrl[6] = handle; vdi (); return ( (uint32_t) intout[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Translate VDI colour index to colour table index«
| ||||||||
Opcode: | 206 (Sub-Opcode 3)
| ||||||||
Syntax: | int16_t v_ctab_idx2vdi( int16_t handle, int16_t index );
| ||||||||
Description: | The call v_ctab_idx2vdi converts the colour table index into a
VDI colour index.
For resolutions up to 256 colours, index is the index for the COLOR_ENTRY in the current colour table and simultaneously also the actual pixel value that is entererd in the bitmap. For graphic formats with more than 256 colours, index continues to denote the entry in the colour table; the pixel value however is output by the VDI as a direct RGB value in the bitmap. | ||||||||
Return value: | The function returns the old VDI colour index for vsl_color
or similar functions
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Colour table functions
| ||||||||
See also: | Binding
|
C: | int16_t v_ctab_idx2vdi( int16_t handle, int16_t index );
| ||||||||||||||||||||||||||||||
Binding: |
int16_t v_ctab_idx2vdi( int16_t handle, int16_t index ) { intin[0] = index; contrl[0] = 206 contrl[1] = 0; contrl[3] = 1; contrl[5] = 3; contrl[6] = handle; vdi (); return ( intout[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Translate VDI Color Index To Color Table Index«
| ||||||||
Opcode: | 206 (sub-opcode 4)
| ||||||||
Syntax: | int16_t v_ctab_vdi2idx( int16_t handle, int16_t vdi_index );
| ||||||||
Description: | The call v_ctab_vdi2idx translates the VDI colour index to a
colour table index.
For resolutions up to 256 colours, index is the index for the COLOR_ENTRY in the current colour table and simultaneously also the actual pixel value that is entererd in the bitmap. For graphic formats with more than 256 colours, index continues to denote the entry in the colour table; the pixel value however is output by the VDI as a direct RGB value in the bitmap. | ||||||||
Return value: | The function returns the index for the colour table.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Colour table functions
| ||||||||
See also: | Binding
|
C: | int16_t v_ctab_vdi2idx( int16_t handle, int16_t vdi_index );
| ||||||||||||||||||||||||||||||
Binding: |
int16_t v_ctab_vdi2idx( int16_t handle, int16_t vdi_index ) { intin[0] = vdi_index; contrl[0] = 206 contrl[1] = 0; contrl[3] = 1; contrl[5] = 4; contrl[6] = handle; vdi (); return ( intout[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Delete colour table«
| ||||||||
Opcode: | 206 (Sub-Opcode 9)
| ||||||||
Syntax: | int16_t v_delete_ctab( int16_t handle, COLOR_TAB *ctab );
| ||||||||
Description: | The call v_delete_ctab clears a colour table created with
v_create_ctab.
| ||||||||
Return value: | 0: Error
1: All OK | ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Colour table functions
| ||||||||
See also: | Binding v_create_ctab
|
C: | int16_t v_delete_ctab( int16_t handle, COLOR_TAB *ctab );
| ||||||||||||||||||||||||||||||
Binding: |
int16_t v_delete_ctab( int16_t handle, COLOR_TAB *ctab ) { intin[0..1] = ctab; contrl[0] = 206 contrl[1] = 0; contrl[3] = 2; contrl[5] = 9; contrl[6] = handle; vdi (); return ( intout[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Delete inverse colour table reference«
| ||||||||
Opcode: | 208 (Sub-Opcode 1)
| ||||||||
Syntax: | int16_t v_delete_itab( int16_t handle, ITAB_REF *itab );
| ||||||||
Description: | The call v_delete_itab releases the memory used for an inverse
colour table.
| ||||||||
Return value: | 0: Error
1: All OK | ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Colour table functions
| ||||||||
See also: | Binding
|
C: | int16_t v_delete_itab( int16_t handle, ITAB_REF *itab );
| ||||||||||||||||||||||||||||||
Binding: |
int16_t v_delete_itab( int16_t handle, ITAB_REF *itab ) { intin[0..1] = itab; contrl[0] = 208; contrl[1] = 0; contrl[3] = 2; contrl[5] = 1; contrl[6] = handle; vdi (); return ( intout[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Get unique colour table ID« - Return unique ID for a new
colour table.
| ||||||
Opcode: | 206 (Sub-Opcode 6)
| ||||||
Syntax: | int32_t v_get_ctab_id( int16_t handle );
| ||||||
Description: | If a program builds up its own colour table, a unique ID has to
be obtained from the VDI, so that different tables also have
different IDs. v_get_ctab_id returns an ID for this case.
| ||||||
Return value: | The function returns a unique ID for a new colour table.
| ||||||
Availability: | As of NVDI 5.00.
| ||||||
Group: | Colour table functions
| ||||||
See also: | Binding
|
C: | int32_t v_get_ctab_id( int16_t handle );
| |||||||||||||||||||||||||||
Binding: |
int32_t v_get_ctab_id( int16_t handle ) { contrl[0] = 206 contrl[1] = 0; contrl[3] = 0; contrl[5] = 6; contrl[6] = handle; vdi (); return ( (int32_t) intout[0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Translate pixel value to colour entry«
| ||||||||||
Opcode: | 204 (Sub-Opcode 1)
| ||||||||||
Syntax: | int32_t v_value2color( int16_t handle, uint32_t value,
COLOR_ENTRY *color );
| ||||||||||
Description: | The call v_value2color returns the colour of a pixel value.
| ||||||||||
Return value: | The function returns the colour value and the set colour space.
| ||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||
Group: | Colour table functions
| ||||||||||
See also: | Binding
|
C: | int32_t v_value2color( int16_t handle, uint32_t value,
COLOR_ENTRY *color );
| |||||||||||||||||||||||||||||||||
Binding: |
int32_t v_value2color( int16_t handle, uint32_t value, COLOR_ENTRY *color ) { intin[0..1] = value; contrl[0] = 204; contrl[1] = 0; contrl[3] = 2; contrl[5] = 1; contrl[6] = handle; vdi (); color = intout[2..5]; return ( (int32_t) intout[0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Inquire current colour table«
| ||||||||||
Opcode: | 206 (Sub-Opcode 0)
| ||||||||||
Syntax: | int16_t vq_ctab( int16_t handle, int32_t ctab_length, COLOR_TAB
*ctab );
| ||||||||||
Description: | The call vq_ctab copies the current colour table, which the
VDI manages under the passed handle, into the region to
which ctab points. If the colour table is longer than
ctab_length, then no value is returned in intout, and
contrl[4] is then 0. A colour table can hold a maximum of 256 entries
(as the VDI supports a maximum of 256 colour pens, there cannot be
more) and hence this gives the maximum length from the size of the
header plus 256 * sizeof( COLOR_ENTRY ).
| ||||||||||
Return value: | The function returns 0 for an error, or 1 for 'All OK'.
| ||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||
Group: | Colour table functions
| ||||||||||
See also: | Binding
|
C: | int16_t vq_ctab( int16_t handle, int32_t ctab_length, COLOR_TAB
*ctab );
| ||||||||||||||||||||||||||||||
Binding: |
int16_t vq_ctab( int16_t handle, int32_t ctab_length, COLOR_TAB *ctab ) { intin[0..1] = ctab_length; intout points to ctab contrl[0] = 206; contrl[1] = 0; contrl[3] = 2; contrl[5] = 0; contrl[6] = handle; vdi (); if ( contrl[4] ) return( 1 ); /* All OK */ else return( 0 ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Inquire colour table entry«
| ||||||||||
Opcode: | 206 (Sub-Opcode 1)
| ||||||||||
Syntax: | int32_t vq_ctab_entry( int16_t handle, int16_t index,
COLOR_ENTRY *color );
| ||||||||||
Description: | The call vq_ctab_entry obtains the colour space and the colour
of a colour table entry.
| ||||||||||
Return value: | The function returns the colour space of a colour table entry.
| ||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||
Group: | Colour table functions
| ||||||||||
See also: | Binding
|
C: | int32_t vq_ctab_entry( int16_t handle, int16_t index,
COLOR_ENTRY *color );
| |||||||||||||||||||||||||||||||||
Binding: |
int32_t vq_ctab_entry( int16_t handle, int16_t index, COLOR_ENTRY *color ) { intin[0] = index; contrl[0] = 206; contrl[1] = 0; contrl[3] = 1; contrl[5] = 1; contrl[6] = handle; vdi (); color = intout[2..5]; return( ( int32_t ) intout [0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Inquire current colour table ID«
| ||||||
Opcode: | 206 (Sub-Opcode 2)
| ||||||
Syntax: | int32_t vq_ctab_id( int16_t handle );
| ||||||
Description: | The call vq_ctab_id returns the ID of the current colour table
for handle. From this ID a program can ascertain whether the
colour table of the device that it is using has been changed.
| ||||||
Return value: | The function returns the ID of the current colour
| ||||||
Availability: | As of NVDI 5.00.
| ||||||
Group: | Colour table functions
| ||||||
See also: | Binding
|
C: | int32_t vq_ctab_id( int16_t handle );
| |||||||||||||||||||||||||||
Binding: |
int32_t vq_ctab_id( int16_t handle ) { contrl[0] = 206; contrl[1] = 0; contrl[3] = 0; contrl[5] = 2; contrl[6] = handle; vdi (); return( ( int32_t ) intout [0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Inquire default colour table« - Return system colour table.
| ||||||||||
Opcode: | 206 (Sub-Opcode 7)
| ||||||||||
Syntax: | int16_t vq_dflt_ctab( int16_t handle, int32_t ctab_length,
COLOR_TAB *ctab );
| ||||||||||
Description: | The call vq_dflt_ctab copies the preferred system colour table
for the set colour depth into the memory block to which ctab
points. If the colour table is longer than ctab_length, then
no value is returned in intout, and contrl[4] is then 0. A colour
table can hold a maximum of 256 entries (as the VDI supports a
maximum of 256 colour pens, there cannot be more) and hence this gives
the maximum length from the size of the header plus 256 * sizeof(
COLOR_ENTRY ).
| ||||||||||
Return value: | The function returns 0 for an error, or 1 for 'All OK'.
| ||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||
Group: | Colour table functions
| ||||||||||
See also: | Binding
|
C: | int16_t vq_dflt_ctab( int16_t handle, int32_t ctab_length,
COLOR_TAB *ctab );
| ||||||||||||||||||||||||||||||
Binding: |
int16_t vq_dflt_ctab( int16_t handle, int32_t ctab_length, COLOR_TAB *ctab ) { intin[0..1] = ctab_length; intout zeigt auf ctab contrl[0] = 206; contrl[1] = 0; contrl[3] = 2; contrl[5] = 7; contrl[6] = handle; vdi (); if ( contrl[4] ) return( 1 ); /* All OK */ else return( 0 ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Inquire pixel format and colour space«
| ||||||||
Opcode: | 204 (Sub-Opcode 3)
| ||||||||
Syntax: | int32_t vq_px_format( int16_t handle, uint32_t *px_format );
| ||||||||
Description: | The call vq_px_format obtains the set pixel format and the set
colour space.
| ||||||||
Return value: | The function returns the colour space set.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Colour table functions
| ||||||||
See also: | Binding
|
C: | int32_t vq_px_format( int16_t handle, uint32_t *px_format );
| ||||||||||||||||||||||||||||||
Binding: |
int32_t vq_px_format( int16_t handle, uint32_t *px_format ) { contrl[0] = 204; contrl[1] = 0; contrl[3] = 0; contrl[5] = 3; contrl[6] = handle; vdi (); px_format = intout[2..3]; return ( (int32_t) intout[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Set colour table«
| ||||||||
Opcode: | 205 (Sub-Opcode 0)
| ||||||||
Syntax: | int16_t vs_ctab( int16_t handle, COLOR_TAB *ctab );
| ||||||||
Description: | The call vs_ctab copies the colour table, sets the colours in
the hardware if a CLUT is present, and returns the number of set
colour entries. If at all possible, programs should not change the
colours of the screen!
| ||||||||
Return value: | The function returns the number of entries set.
| ||||||||
Availability: | As of NVDI 5.00.
| ||||||||
Group: | Colour table functions
| ||||||||
See also: | Binding
|
C: | int16_t vs_ctab( int16_t handle, COLOR_TAB *ctab );
| ||||||||||||||||||||||||||||||
Binding: |
int16_t vs_ctab( int16_t handle, COLOR_TAB *ctab ) { contrl[0] = 205; contrl[1] = 0; contrl[3] = ctab->length / 2; /* Length of table / 2 */ contrl[5] = 0; contrl[6] = handle; intin points to ctab vdi (); return ( intout[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Set colour table entry«
| ||||||||||||
Opcode: | 205 (sub-opcode 1)
| ||||||||||||
Syntax: | int16_t vs_ctab_entry( int16_t handle, int16_t index, int32_t
color_space, COLOR_ENTRY *color );
| ||||||||||||
Description: | The call vs_ctab_entry sets a colour value in the colour table,
i.e. for modes with up to 256 colours a CLUT entry will be changed. If
at all possible, programs should not change the colours of the screen!
| ||||||||||||
Return value: | The function returns the number of entries set.
| ||||||||||||
Availability: | As of NVDI 5.00.
| ||||||||||||
Group: | Colour table functions
| ||||||||||||
See also: | Binding
|
C: | int16_t vs_ctab_entry( int16_t handle, int16_t index, int32_t
color_space, COLOR_ENTRY *color );
| ||||||||||||||||||||||||||||||||||||
Binding: |
int16_t vs_ctab_entry( int16_t handle, int16_t index, int32_t color_space, COLOR_ENTRY *color ) { intin[0] = index; intin[1..2] = color_space; intin[3..6] = color; contrl[0] = 205; contrl[1] = 0; contrl[3] = 7; contrl[5] = 1; contrl[6] = handle; vdi (); return ( intout[0] ); } | ||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Set default colour table« - Set system colour table.
| ||||||
Opcode: | 205 (Sub-Opcode 2)
| ||||||
Syntax: | int16_t vs_dflt_ctab( int16_t handle );
| ||||||
Description: | The call vs_dflt_ctab sets the system colour table for the
current bit-depth.
| ||||||
Return value: | The function returns the number of entries set.
| ||||||
Availability: | As of NVDI 5.00.
| ||||||
Group: | Colour table functions
| ||||||
See also: | Binding
|
C: | int16_t vs_dflt_ctab( int16_t handle );
| |||||||||||||||||||||||||||
Binding: |
int16_t vs_dflt_ctab( int16_t handle ) { contrl[0] = 205; contrl[1] = 0; contrl[3] = 0; contrl[5] = 2; contrl[6] = handle; vdi (); return ( intout[0] ); } | |||||||||||||||||||||||||||
GEM-Arrays: |
|