VCLib Documentation  6.12.2

Periphery and Hardware Related Functions

Periphery and Hardware Related Functions

Functions

I32 vc_lutU8_generate_linear (U8 *lut, U32 entries, U16 zeroVal, U16 satVal)
 Sets a linear U8 valued lookup table. More...
 
I32 vc_lutU8_generate_sqrt (U8 *lut, U32 entries, U16 zeroVal, U16 satVal)
 Sets a squareroot U8 valued lookup table. More...
 
I32 vc_lutU8_generate_log (U8 *lut, U32 entries, U16 zeroVal, U16 satVal)
 Sets a logarithmic U8 valued lookup table. More...
 
I32 set_ovl_false_color (I32 table)
 Set Translucent Overlay LUT to False Color Palette. More...
 
I32 set_translucent_to_value (I32 table, I32 r, I32 g, I32 b)
 Set Translucent Overlay LUT to Fixed Value. More...
 
I32 display_directions (image *src, I32 thresh, I32 startx, I32 starty)
 Display a Directional Image using Overlay. More...
 

Detailed Description

Functions in this group provide access to special camera hardware.

Function Documentation

◆ vc_lutU8_generate_linear()

I32 vc_lutU8_generate_linear ( U8 lut,
U32  entries,
U16  zeroVal,
U16  satVal 
)

This function sets a linear U8 valued lookup table to map more than eight bit of grey values to eigtht bits. For each value n the value at the lookup table will be lut[n] according to the following formula:

\[ \texttt{lut}[i]= \left\{\begin{array}{rl} 0, & \textrm{if } i\geq \texttt{zeroVal}\\ 255 * \frac{\hfill i - \texttt{zeroVal}}{\texttt{satVal} - \texttt{zeroVal}}, & \textrm{otherwise}\\ 255, & \textrm{if } i\geq \texttt{satVal}\\ \end{array}\right. \]

Return values
0on Success.
ERR_PARAMif zeroVal or satVal >= entries, or zeroVal >= satVal.

◆ vc_lutU8_generate_sqrt()

I32 vc_lutU8_generate_sqrt ( U8 lut,
U32  entries,
U16  zeroVal,
U16  satVal 
)

This function sets a squareroot U8 valued lookup table to map more than eight bit of grey values to eigtht bits. For each value n the value at the lookup table will be lut[n] according to the following formula:

\[ \texttt{lut}[i]= \left\{\begin{array}{rl} 0, & \textrm{if } i\geq \texttt{zeroVal}\\ 255 * \frac{\hfill \sqrt{i - \texttt{zeroVal}}}{\sqrt{\texttt{satVal} - \texttt{zeroVal}}}, & \textrm{otherwise}\\ 255, & \textrm{if } i\geq \texttt{satVal}\\ \end{array}\right. \]

Return values
0on Success.
ERR_PARAMif zeroVal or satVal >= entries, or zeroVal >= satVal.

◆ vc_lutU8_generate_log()

I32 vc_lutU8_generate_log ( U8 lut,
U32  entries,
U16  zeroVal,
U16  satVal 
)

This function sets a logarithmic U8 valued lookup table to map more than eight bit of grey values to eigtht bits. For each value n the value at the lookup table will be lut[n] according to the following formula:

\[ \texttt{lut}[i]= \left\{\begin{array}{rl} 0, & \textrm{if } i\geq \texttt{zeroVal}\\ 255 * \frac{\hfill \ln(i - \texttt{zeroVal})}{\ln(\texttt{satVal} - \texttt{zeroVal})}, & \textrm{otherwise}\\ 255, & \textrm{if } i\geq \texttt{satVal}\\ \end{array}\right. \]

Return values
0on Success.
ERR_PARAMif zeroVal or satVal >= entries, or zeroVal >= satVal.

◆ set_ovl_false_color()

I32 set_ovl_false_color ( I32  table)

This function sets one of the translucent overlay tables to a color palette with equal intensity and saturation and colors covering the complete spectrum. table is the number of the translucent table (1, 2, 3); table 1 corresponds to bit 0 in the overlay, table 2 to bit 2 and table 3 to bit 3.

Parameters
tablenumber of tranclucent table = 1, 2, 3
Return values
-1of table out of Range [1,3].
ERR_NONEon Success.

◆ set_translucent_to_value()

I32 set_translucent_to_value ( I32  table,
I32  r,
I32  g,
I32  b 
)

This function sets one of the translucent overlay tables to a fixed color defined by r (red), g (green) and b (blue). table is the number of the translucent table (1, 2, 3); table 1 corresponds to bit 0 in the overlay, table 2 to bit 2 and table 3 to bit 2.

Parameters
tableNumber of Tranclucent Table = 1, 2, 3.
r,g,bValues for Red, Green and Blue Component.
Return values
-1of table out of Range [1,3].
ERR_NONEon Success.

◆ display_directions()

I32 display_directions ( image src,
I32  thresh,
I32  startx,
I32  starty 
)

For the display of a directional image (e.g. from a vector gradient) a color palette is quite useful. The input image variable must be of type IMAGE_VECTOR. This function displays the directions using a false color palette in the translucent overlay. In addition, a threshold may be selected for the magnitude, i.e. all image pixels with a magnitude larger than the threshold are displayed in false colors, all other pixels are black. The function copies the directions of the source image to a display area in main display memory with identical size and coordinates given by (startx, starty). In the overlay memory, the translucent bit planes 0 and 1 are used for this feature. All other overlay planes are set to zero by this function.

Note
The logical pages for display and overlay must be set correctly for this function.
Parameters
srcSource Image of Type IMAGE_VECTOR.
threshThreshold for Gradient Binarization.
startx,startyCoordinates of Upper Left Starting Point of the Image Display.
Memory Consumption
None.