VCLib Documentation  6.12.2

Drawing Pixels

Drawing Pixels

Modules

 Test Pattern Generators
 

Macros

#define vc_draw_edgecontours_d(img, xyList, nr, col, subpixelIff1)   vc_draw_edgecontours_( img, xyList, nr, col, subpixelIff1, (void (*)())FL_wpset_U8)
 Draws Edgecontours from List. More...
 

Functions

I32 vc_draw_line (image *a, F32 cx, F32 cy, F32 b, I32 col, void(*func)())
 Draws a Line in Normalized Floatingpoint Form. More...
 
I32 vc_line_restrict_to_image (image *img, I32 x0, I32 y0, I32 x1, I32 y1, I32 *x0Rstr, I32 *y0Rstr, I32 *x1Rstr, I32 *y1Rstr)
 Restricts Line Coordinates to fit an Image. More...
 
I32 line (image *a, I32 x1, I32 y1, I32 x2, I32 y2, I32 col, void(*func)())
 Draws a Line between two Coordinates. More...
 
void chprint (char *str, image *a, I32 cx, I32 cy)
 Draws String Content. More...
 
void chprint1 (char *str, image *a, I32 cx, I32 cy, I32 val)
 Draws String Content. More...
 
I32 chprint_centered_at_pos_lines (image *img, char *acStr, I32 x, I32 y, I32 cx, I32 cy, I32 col, I32 lineNr, I32 linesTotal)
 Draws String Content to Position. More...
 
void chprint_4x6 (image *img, char *pText, int chars, char uppercasingIff1, unsigned char colTxt, int colBg)
 Draws String Content using a Small 4x6 Font. More...
 
void chprint_4x6_select (image *img, int entries, char uppercasingIff1, unsigned char colTxt, int colBg, int highlightEntryIdx, unsigned char colHighlightTxt, int colHighlightBg, int selectEntryIdx, unsigned char colSelectTxt, int colSelectBg, unsigned char colBothTxt, int colBothBg,...)
 Draws String Content using a Small 4x6 Font, different Highlight and Select Color. More...
 
void MarkBoxN (image *img, I32 x, I32 y, I32 dx, I32 dy, I32 col, void(*func)())
 Draws a Box. More...
 
void MarkSolidBoxN (image *img, I32 x, I32 y, I32 dx, I32 dy, I32 col, void(*func)())
 Draws a Solid Box. More...
 
void MarkCrossN (image *img, I32 x, I32 y, I32 col, I32 size, void(*func)())
 Draws a Cross. More...
 
void vc_draw_polygon (image *psImgOut, U32 u32CornerCount, I32 *pi32PxLst, I32 col, void(*func)())
 Draws a Polygon Contour. More...
 
I32 fill_polygon_simple (image *psImgOut, U8 color, U32 u32CornerCount, I32 *pi32PxLst, U8 u8FillBackgroundIff1)
 
void draw_polyline (image *psImgOut, U32 u32CornerCount, I32 *pi32PxLst, I32 col, void(*func)())
 Draws a Polyline Contour. More...
 
I32 vc_draw_circle (image *a, I32 px, I32 py, I32 rad, I32 col, void(*func)())
 Draws a Circle (with Window-Clipping). More...
 
void ellipse (image *a, I32 col, void(*func)())
 Draws an Ellipse. More...
 
I32 draw_histo (image *Graph, U32 *Histo, I32 size, I32 BackgndColor, I32 Color, I32 i32Mode, void(*func)())
 Draws a Grey Level Histogram. More...
 
I32 draw_histo_quantile (image *pOut, U32 *pu32Histo, U8 u8Percentage, U8 u8Color)
 Draws Quantile at draw_histo() Histogram. More...
 
I32 draw_histo_line (image *pOut, U8 u8Column, U8 u8Color)
 Draws Line at a Grey Value at draw_histo() Histogram. More...
 
I32 vc_draw_edgecontours_ (image *img, I32 *xyList, I32 nr, I32 col, I8 subpixelIff1, void(*func)())
 Draws Edgecontours from List. More...
 
void frame (image *a, I32 col, void(*func)())
 Draws a Frame. More...
 
void dframe (image *a, I32 col, void(*func)())
 Draws a Double-Width Frame. More...
 
void marker (image *a, I32 col, void(*func)())
 Draws a Marker. More...
 
void dmarker (image *a, I32 col, void(*func)())
 Draws a Double-Width Marker. More...
 
I32 vc_image_fill_small_regions (image *imgIn, image *imgOut, I32 chn, I32 lowthr, I32 hithr, I32 labelMethod, I32 minPixel, U32 col)
 Fills Small Regions of an Image Channel. More...
 
void dashed_U8 (U32 count, U8 *ad_list[], I32 value)
 Basic Drawing Function for Dashed Style. More...
 
void dotted_U8 (U32 count, U8 *ad_list[], I32 value)
 Basic Drawing Function for Dotted Style. More...
 
void needled_U8 (U32 count, U8 *ad_list[], I32 value)
 Basic Drawing Function for Needle Style. More...
 
I32 linexy (I32 dx, I32 dy, I32 *xy)
 Basic Line Creation Routine. More...
 
I32 EllipseXY (I32 a, I32 b, I32 *xyc)
 Basic Quarter Ellipse Creation. More...
 
I32 clip (I32 N, I32 *xy_src, I32 *xy_dst, I32 x_min, I32 x_max, I32 y_min, I32 y_max)
 Performs Window-Clipping for Coordinates at a Pixellist. More...
 
void translate (I32 N, I32 *xy_src, I32 *xy_dst, I32 mx, I32 my)
 Translates Coordinates of a Pixellist. More...
 
void PL_transform (I32 N, I32 *xy_src, I32 *xy_dst, I32 mx, I32 my, F32 sx, F32 sy)
 Linear Transforms Coordinates of a Pixellist. More...
 
#define draw_histod(Graph, Histo, size, BackgndColor, Color, i32Mode)   draw_histo(Graph, Histo, size, BackgndColor, Color, i32Mode, (void (*)())FL_wpset_U8)
 Draws a Histogram in a given Color. More...
 
#define draw_histox(Graph, Histo, size, BackgndColor, Color, i32Mode)   draw_histo(Graph, Histo, size, BackgndColor, Color, i32Mode, (void (*)())FL_wpxor_U8)
 XORs a Histogram of a given Color within an Image. More...
 
I32 rlc_fill_polygons_simple (U16 *rlc, U16 rlcDx, U16 rlcDy, U32 rlcMaxBytes, U32 lstCnt, I32 *xyLst, U32 *xyCnt)
 
#define vc_draw_polygond(a, cornercount, pxLst, col)   vc_draw_polygon(a, cornercount, pxLst, col, (void (*)())FL_wpset_U8)
 Draws a Polygon Contour in a given Color. More...
 
#define vc_draw_polygonx(a, cornercount, pxLst, col)   vc_draw_polygon(a, cornercount, pxLst, col, (void (*)())FL_wpxor_U8)
 XORs a Polygon Contour of a given Color with an Image. More...
 
#define draw_polylined(a, cornercount, pxLst, col)   draw_polyline(a, cornercount, pxLst, col, (void (*)())FL_wpset_U8)
 Draws a Polyline Contour in a given Color. More...
 
#define draw_polylinex(a, cornercount, pxLst, col)   draw_polyline(a, cornercount, pxLst, col, (void (*)())FL_wpxor_U8)
 XORs a Polyline Contour of a given Color with an Image. More...
 
#define ellipsed(a, c)   ellipse(a, c, (void (*)())FL_wpset_U8)
 Draws an Ellipse in a given Color. More...
 
#define ellipsex(a, c)   ellipse(a, c, (void (*)())FL_wpxor_U8)
 XORs an Elliptic Shaped Contour of a given Color with an Image. More...
 
#define framed(a, col)   frame(a, col, (void (*)())FL_wpset_U8)
 Draws a Frame in a given Color. More...
 
#define framex(a, col)   frame(a, col, (void (*)())FL_wpxor_U8)
 XORs a Frame Shape of a given Color with an Image. More...
 
#define dframed(a, col)   dframe(a, col, (void (*)())FL_wpset_U8)
 Draws a Double-Width Frame in a given Color. More...
 
#define dframex(a, col)   dframe(a, col, (void (*)())FL_wpxor_U8)
 XORs a Double-Width Frame Shape of a given Color with an Image. More...
 
#define markerd(a, col)   marker(a, col, (void (*)())FL_wpset_U8)
 Draws a Marker in a given Color. More...
 
#define markerx(a, col)   marker(a, col, (void (*)())FL_wpxor_U8)
 XORs a Marker Shape of a given Color with an Image. More...
 
#define dmarkerd(a, col)   dmarker(a, col, (void (*)())FL_wpset_U8)
 Draws a Double-Width Marker in a given Color. More...
 
#define dmarkerx(a, col)   dmarker(a, col, (void (*)())FL_wpxor_U8)
 XORs a Double-Width Marker Shape of a given Color with an Image. More...
 
I32 IntersectionPoints (image *a, float cx, float cy, float b, I32 *X0, I32 *Y0, I32 *X1, I32 *Y1)
 Calculates Two Intersection Points between a Line and the Boundaries of an Image Variable. More...
 
I32 IntersectionPointsWithRect (float cx, float cy, float b, F32 xMin, F32 yMin, F32 xMax, F32 yMax, F32 *X0, F32 *Y0, F32 *X1, F32 *Y1)
 Calculates Two Intersection Points between a Line and a Boundary Rectangle. More...
 
#define lined(a, x1, y1, x2, y2, c)   line(a, x1, y1, x2, y2, c, (void (*)())FL_wpset_U8)
 Draws a Line in a given Color. More...
 
#define linex(a, x1, y1, x2, y2, c)   line(a, x1, y1, x2, y2, c, (void (*)())FL_wpxor_U8)
 XORs a Line of a given Color within an Image. More...
 
#define vc_draw_lined(a, cx, cy, b, c)   vc_draw_line(a, cx, cy, b, c, (void (*)())FL_wpset_U8)
 Draws a Line in a given Color. More...
 
#define vc_draw_linex(a, cx, cy, b, c)   vc_draw_line(a, cx, cy, b, c, (void (*)())FL_wpxor_U8)
 XORs a Line of a given Color within an Image. More...
 
#define vc_draw_vclined(a, line, c)   vc_draw_line(a, (line)->cx, (line)->cy, (line)->b, c, (void (*)())FL_wpset_U8)
 Draws a vcline in a given Color. More...
 
#define vc_draw_vclinex(a, line, c)   vc_draw_line(a, (line)->cx, (line)->cy, (line)->b, c, (void (*)())FL_wpxor_U8)
 XORs a vcline of a given Color within an Image. More...
 

Detailed Description

Functions in this group output geometrical shapes as pixel data, for example functions drawing circles, markers or lines.

Macro Definition Documentation

◆ vc_draw_lined

#define vc_draw_lined (   a,
  cx,
  cy,
  b,
 
)    vc_draw_line(a, cx, cy, b, c, (void (*)())FL_wpset_U8)

The macro draws a line like described in the vc_draw_line() function.

vc_draw_lined() is a macro which calls vc_draw_line() with basic function FL_wpset_U8() as an argument.

◆ vc_draw_linex

#define vc_draw_linex (   a,
  cx,
  cy,
  b,
 
)    vc_draw_line(a, cx, cy, b, c, (void (*)())FL_wpxor_U8)

The macro XORs a line like described in the vc_draw_line() function with the image's underlying grey values and writes the result to the position.

vc_draw_linex() is a macro which calls vc_draw_line() with basic function FL_wpxor_U8() as an argument.

◆ vc_draw_vclined

#define vc_draw_vclined (   a,
  line,
 
)    vc_draw_line(a, (line)->cx, (line)->cy, (line)->b, c, (void (*)())FL_wpset_U8)

The macro draws a line like described in the vc_draw_line() function.

vc_draw_vclined() is a macro which calls vc_draw_line() with basic function FL_wpset_U8() as an argument.

◆ vc_draw_vclinex

#define vc_draw_vclinex (   a,
  line,
 
)    vc_draw_line(a, (line)->cx, (line)->cy, (line)->b, c, (void (*)())FL_wpxor_U8)

The macro XORs a line like described in the vc_draw_line() function with the image's underlying grey values and writes the result to the position.

vc_draw_vclinex() is a macro which calls vc_draw_line() with basic function FL_wpxor_U8() as an argument.

◆ lined

#define lined (   a,
  x1,
  y1,
  x2,
  y2,
 
)    line(a, x1, y1, x2, y2, c, (void (*)())FL_wpset_U8)

The macro draws a line like described in the line() function.

lined() is a macro which calls line() with basic function FL_wpset_U8() as an argument.

◆ linex

#define linex (   a,
  x1,
  y1,
  x2,
  y2,
 
)    line(a, x1, y1, x2, y2, c, (void (*)())FL_wpxor_U8)

The macro XORs a line like described in the line() function with the image's underlying grey values and writes the result to the position.

linex() is a macro which calls line() with basic function FL_wpxor_U8() as an argument.

◆ vc_draw_polygond

#define vc_draw_polygond (   a,
  cornercount,
  pxLst,
  col 
)    vc_draw_polygon(a, cornercount, pxLst, col, (void (*)())FL_wpset_U8)

The macro draws a polygon as described in the vc_draw_polygon() function using a given color.

vc_draw_polygond() is a macro which calls vc_draw_polygon() with basic function FL_wpset_U8() as an argument.

◆ vc_draw_polygonx

#define vc_draw_polygonx (   a,
  cornercount,
  pxLst,
  col 
)    vc_draw_polygon(a, cornercount, pxLst, col, (void (*)())FL_wpxor_U8)

The macro XORs a polygon as described in the vc_draw_polygon() function with the image's underlying grey values and writes the result to the position.

vc_draw_polygonx() is a macro which calls vc_draw_polygon() with basic function FL_wpxor_U8() as an argument.

◆ draw_polylined

#define draw_polylined (   a,
  cornercount,
  pxLst,
  col 
)    draw_polyline(a, cornercount, pxLst, col, (void (*)())FL_wpset_U8)

The macro draws a polyine as described in the draw_polyline() function using a given color.

draw_polylined() is a macro which calls draw_polyline() with basic function FL_wpset_U8() as an argument.

◆ draw_polylinex

#define draw_polylinex (   a,
  cornercount,
  pxLst,
  col 
)    draw_polyline(a, cornercount, pxLst, col, (void (*)())FL_wpxor_U8)

The macro XORs a polyline as described in the draw_polyline() function with the image's underlying grey values and writes the result to the position.

draw_polylinex() is a macro which calls draw_polyline() with basic function FL_wpxor_U8() as an argument.

◆ ellipsed

#define ellipsed (   a,
 
)    ellipse(a, c, (void (*)())FL_wpset_U8)

The macro draws the contour of an ellipse like described in the ellipse() function.

ellipsed() is a macro which calls ellipse() with basic function FL_wpset_U8() as an argument.

◆ ellipsex

#define ellipsex (   a,
 
)    ellipse(a, c, (void (*)())FL_wpxor_U8)

The macro XORs the contour of an ellipse like described in the ellipse() function with the image's underlying grey values and writes the result to the position.

ellipsex() is a macro which calls ellipse() with basic function FL_wpxor_U8() as an argument.

◆ draw_histod

#define draw_histod (   Graph,
  Histo,
  size,
  BackgndColor,
  Color,
  i32Mode 
)    draw_histo(Graph, Histo, size, BackgndColor, Color, i32Mode, (void (*)())FL_wpset_U8)

The macro draws a histogram like described in the draw_histo() function.

draw_histod() is a macro which calls draw_histo() with basic function FL_wpset_U8() as an argument.

◆ draw_histox

#define draw_histox (   Graph,
  Histo,
  size,
  BackgndColor,
  Color,
  i32Mode 
)    draw_histo(Graph, Histo, size, BackgndColor, Color, i32Mode, (void (*)())FL_wpxor_U8)

The macro XORs a histogram like described in the draw_histo() function with the image's underlying grey values and writes the result to the position.

draw_histod() is a macro which calls draw_histo() with basic function FL_wpxor_U8() as an argument.

◆ vc_draw_edgecontours_d

#define vc_draw_edgecontours_d (   img,
  xyList,
  nr,
  col,
  subpixelIff1 
)    vc_draw_edgecontours_( img, xyList, nr, col, subpixelIff1, (void (*)())FL_wpset_U8)

The macro draws edgecontours like described in the vc_draw_edgecontours_() function.

vc_draw_edgecontours_d() is a macro which calls vc_draw_edgecontours_() with basic function FL_wpset_U8() as an argument.

◆ framed

#define framed (   a,
  col 
)    frame(a, col, (void (*)())FL_wpset_U8)

The macro draws a frame like described in the frame() function using a given color.

framed() is a macro which calls frame() with basic function FL_wpset_U8() as an argument.

◆ framex

#define framex (   a,
  col 
)    frame(a, col, (void (*)())FL_wpxor_U8)

The macro XORs a frame like described in the frame() function with the image's underlying grey values and writes the result to the position.

framex() is a macro which calls frame() with basic function FL_wpxor_U8() as an argument.

◆ dframed

#define dframed (   a,
  col 
)    dframe(a, col, (void (*)())FL_wpset_U8)

The macro draws a double-width frame like described in the dframe() function using a given color.

dframed() is a macro which calls dframe() with basic function FL_wpset_U8() as an argument.

◆ dframex

#define dframex (   a,
  col 
)    dframe(a, col, (void (*)())FL_wpxor_U8)

The macro XORs a double-width frame like described in the dframe() function with the image's underlying grey values and writes the result to the position.

dframex() is a macro which calls dframe() with basic function FL_wpxor_U8() as an argument.

◆ markerd

#define markerd (   a,
  col 
)    marker(a, col, (void (*)())FL_wpset_U8)

The macro draws a marker like described in the marker() function.

markerd() is a macro which calls marker() with basic function FL_wpset_U8() as an argument.

◆ markerx

#define markerx (   a,
  col 
)    marker(a, col, (void (*)())FL_wpxor_U8)

The macro XORs a marker like described in the marker() function with the image's underlying grey values and writes the result to the position.

markerx() is a macro which calls marker() with basic function FL_wpxor_U8() as an argument.

◆ dmarkerd

#define dmarkerd (   a,
  col 
)    dmarker(a, col, (void (*)())FL_wpset_U8)

The macro draws a double width marker like described in the dmarker() function.

dmarkerd() is a macro which calls dmarker() with basic function FL_wpset_U8() as an argument.

◆ dmarkerx

#define dmarkerx (   a,
  col 
)    dmarker(a, col, (void (*)())FL_wpxor_U8)

The macro XORs a double width marker like described in the dmarker() function with the image's underlying grey values and writes the result to the position.

dmarkerx() is a macro which calls dmarker() with basic function FL_wpxor_U8() as an argument.

Function Documentation

◆ vc_draw_line()

I32 vc_draw_line ( image a,
float  cx,
float  cy,
float  b,
I32  col,
void(*)()  func 
)

The function draws a line in normalized floatingpoint form in an image variable. The clipping area for the drawing is defined by the size of the image variable. The drawing method is given by the rendering function func(). The line is defined as: $ cx * x + cy *y - b = 0$.

Parameters
aPoints to Image Variable.
cx,cyVector Normal to Line.
bLine Distance from Origin.
colDrawing Color.
funcFunction for Drawing.
Macro Call func()
vc_draw_lined(a, cx, cy, b, c) Set Pixel to Value c.
vc_draw_vclined(a, line, c) Set Pixel to Value c.
vc_draw_linex(a, cx, cy, b, c) XOR Pixel with c.
vc_draw_vclinex(a, line, c) XOR Pixel with c.
Memory Consumption
None.
See also
bestline().
Return values
ERR_PARAMIf the Line does not cross the Image Field at all.
ERR_NONEOn Success.

◆ vc_line_restrict_to_image()

I32 vc_line_restrict_to_image ( image a,
I32  x0,
I32  y0,
I32  x1,
I32  y1,
I32 x0Rstr,
I32 y0Rstr,
I32 x1Rstr,
I32 y1Rstr 
)

The function restricts line coordinates given to fit an image given.

Parameters
aPointer to Image Variable.
x0,y0,x1,y1Coordinates of the line to be restricted.
x0Rstr,y0Rstr,x1Rstr,y1RstrRestricted Coordinates.
Return values
ERR_NONEiff Output Coordinates can be used.
See also
IntersectionPoints().

◆ line()

I32 line ( image a,
I32  x0,
I32  y0,
I32  x1,
I32  y1,
I32  col,
void(*)()  func 
)

The function draws a line in video memory, or more precisely in the image variable a. The line begins at coordinate (x1, y1) and ends at coordinate (x2,y2), whereby both coordinates relate to the origin (upper left corner) of image variable a. The line can be drawn normally, or as XOR in the gray image or in the overlay.

The drawing stops at the boundary of the image variable.

If the image variable a is part of a larger image variable, then of course going beyond the bounds of the memory area does not cause a problem. col is the gray scale to be drawn. The nature of drawing is specified by passing the pointer (* func)() to the drawing function itself. The following macros use this function: lined(), linex().

Parameters
aPointer to Image Variable.
x0,y0Co-ordinates of First Point.
x1,y1Co-ordinates of Second Point.
colLine Color.
funcDrawing Function.
Returns
0 on Success, Error if Line is outside the Image.
Memory Consumption
8*(max{abs(x2-x1),abs(y2-y1)}+1) Bytes of Heap Memory
See also
linexy().

◆ chprint()

void chprint ( char *  str,
image a,
int  cx,
int  cy 
)

The function outputs the string passed by s to the image variable a. An 8×8 matrix is used for the character set. cx and cy are the width and height of the characters in multiples of 8 pixels. The characters are displayed in white (gray scale 255) on a black background (gray scale 0). If the passed string cannot be displayed in the specified image variable, then it will be truncated to the displayable length. No such check is made in the vertical direction.

This function is mostly used for displaying information on the screen.

Memory Consumption
None.
See also
chprint1();

◆ chprint1()

void chprint1 ( char *  str,
image a,
int  cx,
int  cy,
int  v 
)

The function outputs the string passed by s to the image variable a. An 8×8 matrix is used for the character set. cx and cy are the width and height of the characters in multiples of 8 pixels. The characters are displayed in the gray value given by v on a black background (gray scale 0). If the passed string cannot be displayed in the specified image variable, then it will be truncated to the displayable length. No such check is made in the vertical direction.

This function is mostly used for displaying information on the screen.

Parameters
strThe String to be Drawn.
aOutput Image.
cx,cyHeight of Character, Multiplied by 8 px.
vGrey Value of the text chars (0-255).
Memory Consumption
None.
See also
chprint();

◆ chprint_centered_at_pos_lines()

I32 chprint_centered_at_pos_lines ( image img,
char *  acStr,
I32  x,
I32  y,
I32  cx,
I32  cy,
I32  col,
I32  lineNr,
I32  linesTotal 
)

The function outputs the string passed by acStr to the image variable img centered at the position (x,y). One can apply this function multiple times with the same linesTotal and the lineNr starting at 0 to draw multiple lines of text centered at the position. With appropriate settings for lineNr and linesTotal one can generate a subtitling. If the string exceeds the image, the function tries to move the text into the image to display it completely. If this fails, an the error ERR_BOUNDS occurs. If lineNr or linesTotal is out of range the error ERR_PARAM is raised. An 8×8 matrix is used for the character set. cx and cy are the width and height of the characters in multiples of 8 pixels. The characters are displayed by using the function chprint1().

Memory Consumption
None.
See also
chprint1();

◆ chprint_4x6()

void chprint_4x6 ( image img,
char *  pText,
int  chars,
char  uppercasingIff1,
unsigned char  colTxt,
int  colBg 
)

The function outputs the string passed by pText to the image variable img, each char has only 4x6 pixels. You can convert all chars to uppercase for better readability.

Parameters
pTextThe String to be Drawn.
imgOutput Image.
uppercasingIff1Automatically use uppercase chars for lowercase ones.
colTxtText color
colBgBackground color, not set iff smaller than zero.
Memory Consumption
None.
See also
chprint(); ImageROI()

◆ chprint_4x6_select()

void chprint_4x6_select ( image img,
int  entries,
char  uppercasingIff1,
unsigned char  colTxt,
int  colBg,
int  highlightEntryIdx,
unsigned char  colHighlightTxt,
int  colHighlightBg,
int  selectEntryIdx,
unsigned char  colSelectTxt,
int  colSelectBg,
unsigned char  colBothTxt,
int  colBothBg,
  ... 
)

The function outputs strings of the variable list to the image variable img, each char has only 4x6 pixels. You can convert all chars to uppercase for better readability. If the entry index (starting at 0) fits the highlightEntryIdx or the selectEntryIdx, the defined colors are used (selectEntryIdx overrules highlightEntryIdx).

Parameters
imgOutput Image.
entriesNumber of passed strings.
uppercasingIff1Automatically use uppercase chars for lowercase ones.
colTxtNormal Text color
colBgNormal Background color, not set iff smaller than zero.
highlightEntryIdx,colHighlightTxt,colHighlightBg'highlight' entry index and colors
selectEntryIdx,colHighlightTxt,colHighlightBg'select' entry index and colors
colBothBg,colBothTxt'select' and 'highlight' fall together
...The Strings to be Drawn, they are cast to (char *)
Memory Consumption
None.
See also
chprint_4x6()

◆ MarkBoxN()

void MarkBoxN ( image img,
I32  x,
I32  y,
I32  dx,
I32  dy,
I32  col,
void(*)()  func 
)

The function draws a box with dx x dy pixels and the grey value col.

Memory Consumption
None.

◆ MarkSolidBoxN()

void MarkSolidBoxN ( image img,
I32  x,
I32  y,
I32  dx,
I32  dy,
I32  col,
void(*)()  func 
)

The function draws a solid box with dx x dy pixels and the grey value col.

Memory Consumption
None.

◆ MarkCrossN()

void MarkCrossN ( image area,
I32  x,
I32  y,
I32  Color,
I32  Size,
void(*)()  func 
)

The function draws a cross with 2* Size pixels and the grey value Color.

Memory Consumption
None.

◆ vc_draw_polygon()

void vc_draw_polygon ( image psImgOut,
U32  u32CornerCount,
I32 pi32PxLst,
I32  col,
void(*)()  func 
)

The function draws a polygon in the image pointed by psImgOut. The line can be drawn normally, or as XOR in the gray image or using dotted or other styles.

The drawing stops at the boundary of the image variable.

The nature of drawing is specified by passing the pointer (* func)() to the drawing function itself. The following macros use this function: vc_draw_polygond(), vc_draw_polygonx().

Parameters
psImgOutPointer to Image Variable.
u32CornerCountCorner Count for the Polygon.
pi32PxLstList of u32CornerCount Point Coordinates as Pixel List [I32 P1x, I32 P1y, I32 P2x, ...].
colContour Color.
funcDrawing Function, eg. dashed_U8().

◆ fill_polygon_simple()

I32 fill_polygon_simple ( image psImgOut,
U8  color,
U32  u32CornerCount,
I32 pi32PxLst,
U8  u8FillBackgroundIff1 
)
Return values
ERR_PARAMif (u32CornerCount < 3)
ERR_NONEon Success.
ERR_RLCFMTif Internal RLC Generation fails.
ERR_SLCif Internal SLC Generation fails.
ERR_RLCFMTif Internal RLC Cutting fails.
ERR_RLCFMTif Internal RLC Cutting Frame fails.
ERR_BOUNDSif RLC Pixel Output fails.
ERR_MEMORYif Memory Allocation fails.

◆ draw_polyline()

void draw_polyline ( image psImgOut,
U32  u32CornerCount,
I32 pi32PxLst,
I32  col,
void(*)()  func 
)

The function draws a polyline in the image pointed by psImgOut. The line can be drawn normally, or as XOR in the gray image or using dotted or other styles.

The drawing stops at the boundary of the image variable.

The nature of drawing is specified by passing the pointer (* func)() to the drawing function itself. The following macros use this function: draw_polylined(), draw_polylinex().

Parameters
psImgOutPointer to Image Variable.
u32CornerCountCorner Count of the Polyline.
pi32PxLstList of u32CornerCount Point Coordinates as Pixel List [I32 P1x, I32 P1y, I32 P2x, ...].
colContour Color.
funcDrawing Function, eg. dashed_U8().

◆ vc_draw_circle()

I32 vc_draw_circle ( image a,
I32  px,
I32  py,
I32  rad,
I32  col,
void(*)()  func 
)

The function draws a circle with radius rad and center point (px, py) in an image variable. The clipping area for the drawing is defined by the size of the image variable. The drawing method is given by the rendering function func().

Parameters
aImage Variable used for drawing the Circle.
px,pyCenter Point for Circle.
radCircle Radius.
colCircle Grey Value.
(*func)()Drawing Function.
Macro Call func()
vc_draw_circled(a, px, py, r, c) Set Pixel to Value c.
vc_draw_circlex(a, px, py, r, c) XOR Pixel with c.
Memory Consumption
(48 * rad) Bytes of Heap Memory.
See also
bestcircle(), vc_draw_line().
Return values
ERR_MEMORYIf Memory Allocation failed.
ERR_NONEOn Success.

◆ ellipse()

void ellipse ( image a,
int  col,
void(*)()  func 
)

The function draws an ellipse in video memory, or more precisely in the image variable a. The ellipse fills the image variables, i.e. the ellipse is centered and the horizontal and vertical diameter are equal to the horizontal and vertical size of the image variable. The ellipse can be drawn normally, or as XOR in the gray image or in the overlay.

Warning
No check is made if the ellipse to be drawn partially or entirely leaves the memory area.

The parameter col is the gray scale to be drawn. The nature of drawing is specified by passing the pointer (*func)() to the drawing function itself. The following macros use this function: ellipsed(), ellipsex(), ellipseo(), ellipsez().

Memory Consumption
8*(max{( a->dx),( a->dy)}+1) Bytes of Heap Memory.
See also
EllipseXY(), line().

◆ draw_histo()

I32 draw_histo ( image Graph,
U32 Histo,
I32  size,
I32  BackgndColor,
I32  Color,
I32  i32Mode,
void(*)()  func 
)

The function draws a histogram within an image given by an image variable. Depending on the number of histogram bins specified by size, the function tries to fit the histogram into the horizontal and vertical size of the image. The maximum of all histogram bins is calculated and the histogram is sized so that the histogram maximum will fit the image height.

Horizontally, it would be a good idea to have an image with a size of dx being a multiple of the number of bins, size. If not so, the image is scaled to the actual size and some of the bins will be slightly wider or less wide than others by one pixel.

The histogram can be drawn in different modes, starting with the background color BackgndColor. For a value of -1, the function does not set the background at all. Also available are the normal and the XOR drawing mode, set by using the respective basic function for drawing (see table). Finally, with i32Mode the user can choose between candlestick display or function diagram mode, where the negative walues of i32Mode will add a reference greyscale chart below the histogram.

Operation Call Basic function
draws histogram in given color draw_histod(Graph, Histo, size, BackgndColor, Color, i32Mode) FL_wpset_U8()
XORs histogram within an image draw_histox(Graph, Histo, size, BackgndColor, Color, i32Mode) FL_wpxor_U8()
i32Mode mode of operation
>= 0 draw greyscale below histogram
< 0 no greyscale
+/- 1 candlestick histogram
+/- 2 connect histogram values with lines
Parameters
GraphImage variable (IMAGE_GREY) for histogram output.
HistoThe histogram data.
sizeSize of the histogram (number of bins).
BackgndColorBackground Color, -1 = no background setting.
ColorColor for histogram, XOR with background if Color < 0.
i32ModeMode, see table
funcfunction pointer for drawing routines, see available macros
Returns
Standard Error Code.
Memory Consumption
None.

◆ draw_histo_quantile()

I32 draw_histo_quantile ( image pOut,
U32 pu32Histo,
U8  u8Percentage,
U8  u8Color 
)

The function draws a line at the given quantile at a histogram drawing generated by the function draw_histo() or one of its macros.

Parameters
pOutImage variable (IMAGE_GREY) for histogram output.
pu32HistoThe histogram data.
u8Percentagethe quantile to be drawn.
u8ColorColor for line at quantile, XOR with background if Color < 0.
Returns
Standard Error Code.
Memory Consumption
None.
See also
draw_histo(), draw_histo_line().

◆ draw_histo_line()

I32 draw_histo_line ( image pOut,
U8  u8Column,
U8  u8Color 
)

The function draws a line at a given grey value at a histogram drawing generated by the function draw_histo() or one of its macros.

Parameters
pOutImage variable (IMAGE_GREY) for histogram output.
u8Columnthe grey value to be drawn.
u8ColorColor for line at quantile, XOR with background if Color < 0.
Returns
Standard Error Code.
Memory Consumption
None.
See also
draw_histo(), draw_histo_quantile().

◆ vc_draw_edgecontours_()

I32 vc_draw_edgecontours_ ( image img,
I32 xyList,
I32  nr,
I32  col,
I8  subpixelIff1,
void(*)()  func 
)

The function draws all edgecontours in video memory, or more precisely in the image variable img.

The drawing stops at the boundary of the image variable.

If the image variable a is part of a larger image variable, then of course going beyond the bounds of the memory area does not cause a problem. col is the gray scale to be drawn. The nature of drawing is specified by passing the pointer (* func)() to the drawing function itself. The following macros use this function: lined(), linex().

Parameters
imgPointer to Image Variable.
xyListEdgecontour List obtained by subpixel_edgecontour() or edgecontours_from_edgeimage().
colEdgecontours Color, cycles by number per edgecontour if negative, starting by 0; to see each contour in color cycle, fill a background color first which does not be a multiple of -col.
funcDrawing Function.
Returns
0 on Success, Error if Memory Allocation fails.
See also
subpixel_edgecontour(), edgecontours_from_edgeimage().

◆ frame()

void frame ( image a,
int  col,
void(*)()  func 
)

The function draws a frame in video memory, or more precisely in the image variable a. The frame is drawn precisely on the margin of the image variable, i.e., in the first and last lines, and in the first and last columns of the image variables. The frame can be drawn normally, or as XOR in the gray image or in the overlay. The nature of drawing is specified by passing the pointer (* func)() to the drawing function itself. The following macros use this function: framed(a, col), framex(a, col), frameo(a), framez(a).

Memory Consumption
8*(max{ a->dx, a->dy }+1) Bytes of Heap Memory.
See also
dframe().

◆ dframe()

void dframe ( image a,
int  col,
void(*)()  func 
)

The function draws a frame in video memory, or more precisely in the image variable a. The frame is drawn with a width of 2 pixels. The frame is drawn precisely on the margin of the image variable, i.e., in the lines 0, 1, dx-1 and dx-2, as well as in columns 0,1,dy-1 and dy-2. The frame can be drawn normally, or as XOR in the gray image or in the overlay. The nature of drawing is specified by passing the pointer (*func)() to the drawing function itself. The following macros use this function: dframed(a, col), dframex(a, col), dframeo(a), dframez(a).

Memory Consumption
8*(max{ a->dx, a->dy}+1) Bytes of Heap Memory.
See also
frame().

◆ marker()

void marker ( image a,
int  col,
void(*)()  func 
)

The function draws a marker in video memory, or more precisely in the image variable a. The marker is drawn centered at the image variable. The marker can be drawn normally, or as XOR in the gray image or in the overlay. The nature of drawing is specified by passing the pointer (* func)() to the drawing function itself. The following macros use this function: markerd(), markerx(), markero(), markerz().

Memory Consumption
8*(max{ a->dx, a->dy}+1) Bytes of Heap Memory.
See also
dmarker().

◆ dmarker()

void dmarker ( image a,
int  col,
void(*)()  func 
)

The function draws a marker in video memory, or more precisely in the image variable a. The marker is drawn with a width of 2 pixels. The marker is drawn centered at the image variable. The marker can be drawn normally, or as XOR in the gray image or in the overlay. The nature of drawing is specified by passing the pointer (*func)() to the drawing function itself. For the available basic functions there are macros which make it easier to call the function. The following macros use this function: dmarkerd(), dmarkerx(), dmarkero(), dmarkerz().

Memory Consumption
8*(max{ a->dx, a->dy}+1) Bytes of Heap Memory.
See also
marker().

◆ vc_image_fill_small_regions()

I32 vc_image_fill_small_regions ( image imgIn,
image imgOut,
I32  chn,
I32  lowthr,
I32  hithr,
I32  labelMethod,
I32  minPixel,
U32  col 
)

The function fills all objects of the source image with an area less than min_area with the given color value col. This function can be used to filter out noise and to speed up following routines. The function is intended to eliminate small objects.

Note
If you need to binarize, have segments, features or moments, this function is not the way to go. Look at the rlc_arf() function and operate directly on binary data for speed purposes!
Parameters
imgInInput image.
imgOutOutput image, may be identical to imgIn.
chnChannel number to operate on (st==0,ccmp1==1,ccmp2==2).
lowthr,hithrRegion defining grey value range based on rlcmk2().
labelMethodRegion defining connectedness based on rlc_label().
minPixelRegions of area lower than this value will be colored.
See also
rlc_arf(), rlc_arf2()

◆ dashed_U8()

void dashed_U8 ( U32  count,
U8 ad_list[],
I32  value 
)

The function only draws on the first six of every ten addresses at the pixel list, which will lead to a dashed line if used with the function line(). You may try to use this function with other functions which make use of the base drawing functions, but it is not guaranteed that the result looks always good.

Parameters
countad_list[] Entries.
ad_listAddress Positions to Draw.
valueValue (0-255) to set to Address Positions.
Memory Consumption
None.
See also
dotted_U8(), FL_wpset_U8(), FL_wpxor_U8().

◆ dotted_U8()

void dotted_U8 ( U32  count,
U8 ad_list[],
I32  value 
)

The function only draws on every fourth address at the pixel list, which will lead to a dotted line if used with the function line(). You may try to use this function with other functions which make use of the base drawing functions, but it is not guaranteed that the result looks always good.

Parameters
countad_list[] Entries.
ad_listAddress Positions to Draw.
valueValue (0-255) to set to Address Positions.
Memory Consumption
None.
See also
dashed_U8(), FL_wpset_U8(), FL_wpxor_U8().

◆ needled_U8()

void needled_U8 ( U32  count,
U8 ad_list[],
I32  value 
)

The function only draws on every second address at the pixel list, which will lead to a narrow dotted line if used with the function line(). You may try to use this function with other functions which make use of the base drawing functions, but it is not guaranteed that the result looks always good.

Parameters
countad_list[] Entries.
ad_listAddress Positions to Draw.
valueValue (0-255) to set to Address Positions.
Memory Consumption
None.
See also
dashed_U8(), FL_wpset_U8(), FL_wpxor_U8().

◆ linexy()

I32 linexy ( I32  dx,
I32  dy,
I32 xy 
)

The function creates a list of coordinates which creates the (x, y) coordinates for all pixels on a line. The line begins at the origin (0,0) and ends at the point (dx, dy). This routine creates a list of (x, y) coordinates which are stored starting at the memory address specified by the pointer xy. The list contains x-coordinates and y-coordinates in an alternating order. The function returns the number of generated line points minus 1.

  1. Access as a two-dimensional array
I32 xyarr[1024][2];
I32 dx = 100;
I32 dy = 100;
I32 count, x, y;
count = linexy(dx, dy, xyarr) + 1;
x = xyarr[0][0]; // x-coordinate of 1st pixel
y = xyarr[0][1]; // y-coordinate of 1st pixel
  1. Access as a struct array
typedef struct { int x; int y; } vcpt;
...
vcpt *xy;
I32 dx = 100;
I32 dy = 100;
I32 count, x, y;
xy = (vcpt *)vcmalloc(1024);
count = linexy(dx, dy, (I32 *)xy) + 1;
x = xy->x; // x-coordinate of 1st pixel
y = xy->y; // y-coordinate of 1st pixel
xy++; // address next coordinate

The return value of the function is the number of coordinates created.

See also
line().

◆ EllipseXY()

I32 EllipseXY ( int  a,
int  b,
int *  xyc 
)

The function creates a list of coordinates which creates the (x,y) coordinates for a quarter of an ellipse. a and b are the two half axes of the ellipse, the ellipse is centered at the origin (0,0). The function only outputs positive values for x and y. This routine creates a list of (x,y) coordinates which are stored starting at the memory address specified by the pointer xyc. The list contains first each x-coordinate and then the y-coordinate, respectively. The list should have a size of max(a,b) to assure proper operation. The return value of the function is the number of coordinates created.

See also
ellipse(), linexy().

◆ clip()

I32 clip ( I32  N,
I32 xy_src,
I32 xy_dst,
I32  x_min,
I32  x_max,
I32  y_min,
I32  y_max 
)

The function performs window-clipping for the (x, y) coordinates in the pixellist. The coordinates are copied from xy_src to xy_dst, if they are in a rectangle defined by x_min, x_max, y_min and y_max, i.e. (x_min <= x < x_max) and (y_min <= y < y_max) It is allowed to use the function in-place, i.e. xy_dst = xy_src.

Parameters
NCount of Coordinates in xy_src
xy_srcSource Pixellist.
xy_dstDestination Pixellist.
x_min,x_max,y_min,y_maxBorders, see Text.
Return values
CountCount of Coordinates in the result list xy_dst.
Memory Consumption
None.

◆ translate()

void translate ( I32  N,
I32 xy_src,
I32 xy_dst,
I32  mx,
I32  my 
)

The function performs a translation operation for the (x, y) coordinates in the pixellist xy_src. The vector (mx, my) is added to all coordinates, the result is written to xy_dst. It is allowed to use the function in-place, i.e. xy_dst = xy_src.

Parameters
NCount of Coordinates in xy_src and xy_dst.
xy_srcSource Pixellist.
xy_dstDestination Pixellist.
mx,myTranslation.
Memory Consumption
None.

◆ PL_transform()

void PL_transform ( I32  N,
I32 xy_src,
I32 xy_dst,
I32  mx,
I32  my,
F32  sx,
F32  sy 
)

The function performs a translation operation for the (x, y) coordinates in the pixellist xy_src. The vector (mx, my) is added to all coordinates, then each component is scaled by its respective scale value sx or sy, the result is written to xy_dst. It is allowed to use the function in-place, i.e. xy_dst = xy_src.

Parameters
NCount of Coordinates in xy_src and xy_dst.
xy_srcSource Pixellist.
xy_dstDestination Pixellist.
mx,myTranslation.
sx,syScale.
Memory Consumption
None.

◆ rlc_fill_polygons_simple()

I32 rlc_fill_polygons_simple ( U16 rlc,
U16  rlcDx,
U16  rlcDy,
U32  rlcMaxBytes,
U32  lstCnt,
I32 xyLst,
U32 xyCnt 
)
Return values
ERR_MEMORYif allocation fails.
ERR_PARAMif polygon generation fails.
positiveif polygon exceeds image.

◆ IntersectionPoints()

I32 IntersectionPoints ( image a,
float  cx,
float  cy,
float  b,
I32 X0,
I32 Y0,
I32 X1,
I32 Y1 
)

This function calculates two intersection points between a line and the boundaries of an image variable given. The intersection points are calculated in the following order: Left, Right, Top, Bottom. The line is parameterized in a normalized vector form as: (cx * x) + (cy * y) - b = 0.

Parameters
aPointer to Image Variable.
cx,cy,bLine Parameters.
X0,Y0Coordinates of First Intersection Point.
X1,Y1Coordinates of Second Intersection Point.
See also
IntersectionPointsN(), IntersectionPointsWithRect().
Return values
ERR_PARAMIf Less than 2 Points Found.
ERR_NONEOn Success.

◆ IntersectionPointsWithRect()

I32 IntersectionPointsWithRect ( float  cx,
float  cy,
float  b,
F32  xMin,
F32  yMin,
F32  xMax,
F32  yMax,
F32 X0,
F32 Y0,
F32 X1,
F32 Y1 
)

This function calculates two intersection points between a line and a boundary rectangle. The intersection points are calculated in the following order: Left, Right, Top, Bottom. The line is parameterized in a normalized vector form as: (cx * x) + (cy * y) - b = 0.

Parameters
xMin,yMin,xMax,yMaxBoundary rectangle.
cx,cy,bLine Parameters.
X0,Y0Coordinates of First Intersection Point.
X1,Y1Coordinates of Second Intersection Point.
See also
IntersectionPoints(), IntersectionPointsN().
Return values
ERR_PARAMIf Less than 2 Points Found.
ERR_NONEOn Success.