Copyright © 2005 Data Design Corporation Version 05.02.06
All rights reserved.
28
3.2.3 Display Functions
The API library maintains for each process a device independent bitmap (DIB) which can
be accessed by the display functions in the API. The DIB is created and initialized when the
library is loaded. The image data appears as an oscilloscope gradicule. The size of the image is
nominally 256 pixels high and 512 pixels wide. These dimensions are defined in the header file
and these definitions are used for coding clarity. However, the dimensions are not intended to be
changed and some code may be dependant on these dimensions, such as in the use of 256 vertical
pixels for an 8-bit analog trace.
The display functions work with the DIB to include analog information, change
parameters, display the image, and save the image as may be valid for various operating modes.
Presented below are the exported functions with a brief description of their place in the design.
They are ordered differently than in the source code for clarity of discussion.
DCAPI TR122_D_Clear(void);
The API maintains a copy of the DIB with only the background image on it. The clear function copies the
background image over the final image, thereby eliminating any analog traces and other additions to the image.
DCAPI TR122_D_AssignColors(DWORD *Colors);
Colors are assigned to the elements of the DIB which include the background, gradicule, two analog traces, and the
vertical trigger location bar. The colors are provided in an array pointed to by the argument and with indexes
defined in the header file for elements of the DIB. The colors have the format 00BBGGRR (hexadecimal) for the
blue, green, and red components of each color in one 32-bit integer.
DCAPI TR122_D_TickMarks(BYTE ShowTickMarks);
This routine adds or subtracts the subgradicule tick marks from the DIB based on the argument.
DCAPI TR122_D_PlaceIcons(long LevelChannel1, long LevelChannel2, long LevelTrigger);
This routine places icons for the offset level for each channel and the trigger level on the DIB. The levels are given
in the range 0 to 256. The use of signed arguments allows for the possibility that a caller may assign a value which
is not within the vertical range of the screen (less than 0 or greater than 256). Such an icon will not be displayed for
the offset levels while it will be displayed as an off screen indicator for the trigger level. The trigger level appears in
the color of the trace for the current trigger source channel. If the trigger source is not a channel, then the trigger
icon does not appear.
DCAPI TR122_D_SetOptions(BYTE ShowLines, BYTE ShowChannel1, BYTE ShowChannel2, BYTE ShowTrigger);
The options are elements of the DIB which should or should not be displayed as new plots are generated. These
include the traces for either channel, the vertical bar at the location of the trigger, and the lines between sample
points. The sample points are always displayed as part of any active trace.
DCAPI TR122_D_SetMag(BYTE Channel, BYTE VMag);
The vertical magnification in this sense identifies the 8 bits of the 12-bit sample which should be displayed.
A VMag of 1 indicates the highest order bits. VMag of 2, 4, 8, or 16 amount shift the displayed quantity 1, 2, 3,
or 4 bits toward the least significant bits. The argument is limited to these values and applies only to the specified
channel. This will cause the plot routines to use different bits in the sample, making the display appear more
sensitive by a factor of the VMag.