Output several labelled images to an image (display screen) for Development Purposes. More...
Data Structures | |
struct | SDebugDisplay |
Data Keeper and Management for the Debug Display Output Routine. More... | |
Functions | |
I32 | init_debug_display (SDebugDisplay *psDD, char *pcTitle, U32 u32RasterRows, U32 u32RasterCols, U16 *pu16Meld, image *psDisplay, image *psOvlOrNULL) |
First Initialisation of the Debug Display Environment. More... | |
I32 | deinit_debug_display (SDebugDisplay *psDD) |
Frees Memory allocated by the Function init_debug_display(). More... | |
void | debug_display_draw_environment (SDebugDisplay *psDD) |
Draws Surroundings, Title, etc. More... | |
I32 | debug_display_insert (image *psImgIn, char *pcImgAnchor, U8 u8ToOverlayIff1, char *pcText, U8 u8ScaleContentIff1, U8 u8FitWillCropIff1, SDebugDisplay *psDD, U16 u16ImageIdx) |
Insert Image Data and Label Text to the requested Debug Image. More... | |
The functions in this group allow the display of a large number of images on the screen in an ordered way. The images are resized by request to the desired format. Each image can be assigned a text string which is displayed underneath the image.
You configure a raster containing rectangular regions of indices, where the images will later be drawn to. This is done by passing numbers starting at '0' and raising up to the count of needed images. For convinience, it is the easiest way to define them in an array and provide it as pointer to the specific information holder.
First Initialisation is made by calling the function init_debug_display(). To free allocated memory, one has to call deinit_debug_display() at the end.
Access to the images is easy:
struct SDebugDisplay |
Data Fields | ||
---|---|---|
U8 | u8InactiveIff1 |
A switch that turns the processing off, useful for deactivating debug displaying. |
image | sDisp |
The whole Output Image. |
image | sOvl |
The whole Output Overlay Image (optional). |
char * | pcTitle |
The Title of the Debug Display. |
U32 | u32RasterRows |
Main Raster Row Count of the Image Gallery. |
U32 | u32RasterCols |
Main Raster Column Count of the Image Gallery. |
U16 | u16ImageCount |
The Maximum valid Image Nr available for Destination Request. |
U16 ** | ppu16MeldIdx |
Each Image Area will be going over the raster cells with the same number therein. |
image * | psImg |
The Images accessable by the MeldIdx as Index. |
image * | psLabel |
The Label Text Area for the Images. |
image * | psOvlImg |
The Images accessable by the MeldIdx as Index. |
image * | psOvlLabel |
The Label Text Area for the Images. |
U8 | u8TitleSize |
Size in 8* is Px Height of Title Chars. |
U8 | u8TitleHeightPx |
Height for the Title. |
U8 | u8TextHeightPx |
Height for the Subtext. |
U8 | u8PadColsPx |
Horizontal Space between Images. |
U8 | u8PadRowsPx |
Vertical Space between Images. |
U8 | u8ImgColorBg |
Color Value for the Image Background. |
U8 | u8ImgColorText |
Color Value for the Label Text. |
U8 | u8ImgColorTextBg |
Color Value for the Label Areas. |
U8 | u8ImgColorTitle |
Color Value for the Title Text. |
U8 | u8ImgColorTitleBg |
Color Value for the Title Area. |
U8 | u8ImgColorBorder |
Color Value for the Border around the Images. |
U8 | u8OvlColorBg |
Color Value for the Overlay Background (mostly 0). |
U8 | u8OvlColorText |
Color Value for the Overlay Label Text. |
U8 | u8OvlColorTextBg |
Color Value for the Overlay Label Areas. |
U8 | u8OvlColorTitle |
Color Value for the Overlay Title Text. |
U8 | u8OvlColorTitleBg |
Color Value for the Overlay Title Area. |
U8 | u8OvlColorBorder |
Color Value for the Overlay Border around the Images. |
I32 init_debug_display | ( | SDebugDisplay * | psDD, |
char * | pcTitle, | ||
U32 | u32RasterRows, | ||
U32 | u32RasterCols, | ||
U16 * | pu16Meld, | ||
image * | psDisplay, | ||
image * | psOvlOrNULL | ||
) |
This function initializes the debug display environment by allocating memory and setting default values. You provide the row and column count for the image raster and define the cells to be meld together to one big picture by assigning the same number to them. Counting must be starting by 0 and must increment by one without a gap. Cells to be melt together must form a rectangular shape or undefined behaviour occurs. At least the (previously allocated) display output image must be provided. The raster will be equidistant over the image dimensions, so a cell may be of non-square form. Additionally you may provide an overlay image which can also be accessed easily at your program.
psDD | Initialisation Candidate. |
pcTitle | Shown at the Top of the Debug Display Image. |
u32RasterRows,u32RasterCols | Raster Dimensions of the Debug Display. |
pu16Meld | Raster Points to be Meld to Windows (See Text). |
psDisplay | The Output Image. |
psOvlOrNULL | The Output Overlay Image, may be set to NULL if unused. |
ERR_PARAM | if Display Image and Overlay Image are not of the same size. |
ERR_MEMORY | iff Memory Allocation failed. |
ERR_PARAM | if Disp image too small. |
ERR_FORMAT | if an index number is missing. |
ERR_NONE | on Success. |
I32 deinit_debug_display | ( | SDebugDisplay * | psDD | ) |
The function frees the memory allocated by the function init_debug_display().
psDD | Deinitialisation Candidate. |
ERR_NONE | on Success. |
void debug_display_draw_environment | ( | SDebugDisplay * | psDD | ) |
This function draws surroundings, title, etc. All Information is Cleared! The debug display struct must be initialized beforehand.
psDD | The Target Debug Display Environment. |
I32 debug_display_insert | ( | image * | psImgIn, |
char * | pcImgAnchor, | ||
U8 | u8ToOverlayIff1, | ||
char * | pcText, | ||
U8 | u8ScaleContentIff1, | ||
U8 | u8FitWillCropIff1, | ||
SDebugDisplay * | psDD, | ||
U16 | u16ImageIdx | ||
) |
The image data (if not set to NULL, i.e. if only the label text should be updated) will be copied to the debug image specified by the variable u16ImageIdx
which is the number used to concatenate the cells at the initialization phase. You may specify the Anchor of the input image, meaning, that the given position docks to the same debug image's position. If you'd want to write to Overlay, use the switch. By selecting scaling, the content will be fitted to either show the whole image or the maximum space of the debug image is used for output (cropping).
Text will be cut off at Text start, if it is too long.
psImgIn | Input Image Data, may be NULL if not needed. |
pcImgAnchor | is 't'=top 'm'=middle 'b'=bottom followed by 'l'=left 'c'=center 'r'=right. |
u8ToOverlayIff1 | Outputs Input Image Data or Text to Overlay. |
pcText | will be cropped at beginning iff too long, may be NULL. |
u8ScaleContentIff1 | scales Input Image Data to the Debug Image Size. |
u8FitWillCropIff1 | If u8ScaleContentIff1 is 1, the whole Debug Image will be filled with Data iff 1. |
psDD | The Target Debug Display Environment. |
u16ImageIdx | The Target Image at the Debug Display Environment. |
ERR_NONE | if u8InactiveIff1 is 1 and nothing is done. |
ERR_PARAM | if the Image Index exceeds the maximum Image Number |
ERR_PARAM | if Overlay not set, but should be filled with content. |
ERR_NONE | on Success. |