GUIslice
0.16.0
Embedded GUI in C
|
These routines cause immediate drawing to occur on the primary screen. More...
Functions | |
void | gslc_DrawSetPixel (gslc_tsGui *pGui, int16_t nX, int16_t nY, gslc_tsColor nCol) |
Set a pixel on the active screen to the given color with lock. More... | |
void | gslc_DrawLine (gslc_tsGui *pGui, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1, gslc_tsColor nCol) |
Draw an arbitrary line using Bresenham's algorithm. More... | |
void | gslc_DrawLineH (gslc_tsGui *pGui, int16_t nX, int16_t nY, uint16_t nW, gslc_tsColor nCol) |
Draw a horizontal line. More... | |
void | gslc_DrawLineV (gslc_tsGui *pGui, int16_t nX, int16_t nY, uint16_t nH, gslc_tsColor nCol) |
Draw a vertical line. More... | |
void | gslc_DrawLinePolar (gslc_tsGui *pGui, int16_t nX, int16_t nY, uint16_t nRadStart, uint16_t nRadEnd, int16_t n64Ang, gslc_tsColor nCol) |
Draw a polar ray segment. More... | |
void | gslc_DrawFrameRect (gslc_tsGui *pGui, gslc_tsRect rRect, gslc_tsColor nCol) |
Draw a framed rectangle. More... | |
void | gslc_DrawFrameRoundRect (gslc_tsGui *pGui, gslc_tsRect rRect, int16_t nRadius, gslc_tsColor nCol) |
Draw a framed rounded rectangle. More... | |
void | gslc_DrawFillRect (gslc_tsGui *pGui, gslc_tsRect rRect, gslc_tsColor nCol) |
Draw a filled rectangle. More... | |
void | gslc_DrawFillRoundRect (gslc_tsGui *pGui, gslc_tsRect rRect, int16_t nRadius, gslc_tsColor nCol) |
Draw a filled rounded rectangle. More... | |
void | gslc_DrawFrameCircle (gslc_tsGui *pGui, int16_t nMidX, int16_t nMidY, uint16_t nRadius, gslc_tsColor nCol) |
Draw a framed circle. More... | |
void | gslc_DrawFillCircle (gslc_tsGui *pGui, int16_t nMidX, int16_t nMidY, uint16_t nRadius, gslc_tsColor nCol) |
Draw a filled circle. More... | |
void | gslc_DrawFrameTriangle (gslc_tsGui *pGui, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1, int16_t nX2, int16_t nY2, gslc_tsColor nCol) |
Draw a framed triangle. More... | |
void | gslc_DrawFillTriangle (gslc_tsGui *pGui, int16_t nX0, int16_t nY0, int16_t nX1, int16_t nY1, int16_t nX2, int16_t nY2, gslc_tsColor nCol) |
Draw a filled triangle. More... | |
void | gslc_DrawFrameQuad (gslc_tsGui *pGui, gslc_tsPt *psPt, gslc_tsColor nCol) |
Draw a framed quadrilateral. More... | |
void | gslc_DrawFillQuad (gslc_tsGui *pGui, gslc_tsPt *psPt, gslc_tsColor nCol) |
Draw a filled quadrilateral. More... | |
void | gslc_DrawFillGradSector (gslc_tsGui *pGui, int16_t nQuality, int16_t nMidX, int16_t nMidY, int16_t nRad1, int16_t nRad2, gslc_tsColor cArcStart, gslc_tsColor cArcEnd, int16_t nAngSecStart, int16_t nAngSecEnd, int16_t nAngGradStart, int16_t nAngGradRange) |
Draw a gradient filled sector of a circle with support for inner and outer radius. More... | |
void | gslc_DrawFillSector (gslc_tsGui *pGui, int16_t nQuality, int16_t nMidX, int16_t nMidY, int16_t nRad1, int16_t nRad2, gslc_tsColor cArc, int16_t nAngSecStart, int16_t nAngSecEnd) |
Draw a flat filled sector of a circle with support for inner and outer radius. More... | |
These routines cause immediate drawing to occur on the primary screen.
void gslc_DrawFillCircle | ( | gslc_tsGui * | pGui, |
int16_t | nMidX, | ||
int16_t | nMidY, | ||
uint16_t | nRadius, | ||
gslc_tsColor | nCol | ||
) |
Draw a filled circle.
[in] | pGui | Pointer to GUI |
[in] | nMidX | Center X coordinate |
[in] | nMidY | Center Y coordinate |
[in] | nRadius | Radius of circle |
[in] | nCol | Color RGB value for the fill |
void gslc_DrawFillGradSector | ( | gslc_tsGui * | pGui, |
int16_t | nQuality, | ||
int16_t | nMidX, | ||
int16_t | nMidY, | ||
int16_t | nRad1, | ||
int16_t | nRad2, | ||
gslc_tsColor | cArcStart, | ||
gslc_tsColor | cArcEnd, | ||
int16_t | nAngSecStart, | ||
int16_t | nAngSecEnd, | ||
int16_t | nAngGradStart, | ||
int16_t | nAngGradRange | ||
) |
Draw a gradient filled sector of a circle with support for inner and outer radius.
[in] | pGui | Pointer to GUI |
[in] | nQuality | Number of segments used to depict a full circle. The higher the value, the smoother the resulting arcs. A value of 72 provides 360/72=5 degrees per segment which is a reasonable compromise between smoothness and performance. Note that 360/nQuality should be an integer result, thus the allowable quality settings are: 360 (max quality), 180, 120, 90, 72, 60, 45, 40, 36 (low quality), etc. |
[in] | nMidX | Midpoint X coordinate of circle |
[in] | nMidY | Midpoint Y coordinate of circle |
[in] | nRad1 | Inner sector radius (0 for sector / pie, non-zero for ring) |
[in] | nRad2 | Outer sector radius. Delta from nRad1 defines ring thickness. |
[in] | cArcStart | Start color for gradient fill (with angular range defined by nAngGradStart,nAngGradRange) |
[in] | cArcEnd | End color for gradient fill |
[in] | nAngSecStart | Angle of start of sector drawing (0 at top), measured in degrees. |
[in] | nAngSecEnd | Angle of end of sector drawing (0 at top), measured in degrees. |
[in] | nAngGradStart | For gradient fill, defines the starting angle associated with the starting color (cArcStart) |
[in] | nAngGradRange | For gradient fill, defines the angular range associated with the start-to-end color range (cArcStart..cArcEnd) |
void gslc_DrawFillQuad | ( | gslc_tsGui * | pGui, |
gslc_tsPt * | psPt, | ||
gslc_tsColor | nCol | ||
) |
Draw a filled quadrilateral.
[in] | pGui | Pointer to GUI |
[in] | psPt | Pointer to array of 4 points |
[in] | nCol | Color RGB value for the frame |
void gslc_DrawFillRect | ( | gslc_tsGui * | pGui, |
gslc_tsRect | rRect, | ||
gslc_tsColor | nCol | ||
) |
Draw a filled rectangle.
[in] | pGui | Pointer to GUI |
[in] | rRect | Rectangular region to fill |
[in] | nCol | Color RGB value to fill |
void gslc_DrawFillRoundRect | ( | gslc_tsGui * | pGui, |
gslc_tsRect | rRect, | ||
int16_t | nRadius, | ||
gslc_tsColor | nCol | ||
) |
Draw a filled rounded rectangle.
[in] | pGui | Pointer to GUI |
[in] | rRect | Rectangular region to fill |
[in] | nRadius | Radius for the rounded corners |
[in] | nCol | Color RGB value to fill |
void gslc_DrawFillSector | ( | gslc_tsGui * | pGui, |
int16_t | nQuality, | ||
int16_t | nMidX, | ||
int16_t | nMidY, | ||
int16_t | nRad1, | ||
int16_t | nRad2, | ||
gslc_tsColor | cArc, | ||
int16_t | nAngSecStart, | ||
int16_t | nAngSecEnd | ||
) |
Draw a flat filled sector of a circle with support for inner and outer radius.
[in] | pGui | Pointer to GUI |
[in] | nQuality | Number of segments used to depict a full circle. The higher the value, the smoother the resulting arcs. A value of 72 provides 360/72=5 degrees per segment which is a reasonable compromise between smoothness and performance. |
[in] | nMidX | Midpoint X coordinate of circle |
[in] | nMidY | Midpoint Y coordinate of circle |
[in] | nRad1 | Inner sector radius (0 for sector / pie, non-zero for ring) |
[in] | nRad2 | Outer sector radius. Delta from nRad1 defines ring thickness. |
[in] | cArc | Color for flat fill |
[in] | nAngSecStart | Angle of start of sector drawing (0 at top), measured in degrees. |
[in] | nAngSecEnd | Angle of end of sector drawing (0 at top), measured in degrees. |
void gslc_DrawFillTriangle | ( | gslc_tsGui * | pGui, |
int16_t | nX0, | ||
int16_t | nY0, | ||
int16_t | nX1, | ||
int16_t | nY1, | ||
int16_t | nX2, | ||
int16_t | nY2, | ||
gslc_tsColor | nCol | ||
) |
Draw a filled triangle.
[in] | pGui | Pointer to GUI |
[in] | nX0 | X Coordinate #1 |
[in] | nY0 | Y Coordinate #1 |
[in] | nX1 | X Coordinate #2 |
[in] | nY1 | Y Coordinate #2 |
[in] | nX2 | X Coordinate #3 |
[in] | nY2 | Y Coordinate #3 |
[in] | nCol | Color RGB value for the fill |
void gslc_DrawFrameCircle | ( | gslc_tsGui * | pGui, |
int16_t | nMidX, | ||
int16_t | nMidY, | ||
uint16_t | nRadius, | ||
gslc_tsColor | nCol | ||
) |
Draw a framed circle.
[in] | pGui | Pointer to GUI |
[in] | nMidX | Center X coordinate |
[in] | nMidY | Center Y coordinate |
[in] | nRadius | Radius of circle |
[in] | nCol | Color RGB value for the frame |
void gslc_DrawFrameQuad | ( | gslc_tsGui * | pGui, |
gslc_tsPt * | psPt, | ||
gslc_tsColor | nCol | ||
) |
Draw a framed quadrilateral.
[in] | pGui | Pointer to GUI |
[in] | psPt | Pointer to array of 4 points |
[in] | nCol | Color RGB value for the frame |
void gslc_DrawFrameRect | ( | gslc_tsGui * | pGui, |
gslc_tsRect | rRect, | ||
gslc_tsColor | nCol | ||
) |
Draw a framed rectangle.
[in] | pGui | Pointer to GUI |
[in] | rRect | Rectangular region to frame |
[in] | nCol | Color RGB value for the frame |
void gslc_DrawFrameRoundRect | ( | gslc_tsGui * | pGui, |
gslc_tsRect | rRect, | ||
int16_t | nRadius, | ||
gslc_tsColor | nCol | ||
) |
Draw a framed rounded rectangle.
[in] | pGui | Pointer to GUI |
[in] | rRect | Rectangular region to frame |
[in] | nRadius | Radius for the rounded corners |
[in] | nCol | Color RGB value for the frame |
void gslc_DrawFrameTriangle | ( | gslc_tsGui * | pGui, |
int16_t | nX0, | ||
int16_t | nY0, | ||
int16_t | nX1, | ||
int16_t | nY1, | ||
int16_t | nX2, | ||
int16_t | nY2, | ||
gslc_tsColor | nCol | ||
) |
Draw a framed triangle.
[in] | pGui | Pointer to GUI |
[in] | nX0 | X Coordinate #1 |
[in] | nY0 | Y Coordinate #1 |
[in] | nX1 | X Coordinate #2 |
[in] | nY1 | Y Coordinate #2 |
[in] | nX2 | X Coordinate #3 |
[in] | nY2 | Y Coordinate #3 |
[in] | nCol | Color RGB value for the frame |
void gslc_DrawLine | ( | gslc_tsGui * | pGui, |
int16_t | nX0, | ||
int16_t | nY0, | ||
int16_t | nX1, | ||
int16_t | nY1, | ||
gslc_tsColor | nCol | ||
) |
Draw an arbitrary line using Bresenham's algorithm.
[in] | pGui | Pointer to GUI |
[in] | nX0 | X coordinate of line startpoint |
[in] | nY0 | Y coordinate of line startpoint |
[in] | nX1 | X coordinate of line endpoint |
[in] | nY1 | Y coordinate of line endpoint |
[in] | nCol | Color RGB value for the line |
void gslc_DrawLineH | ( | gslc_tsGui * | pGui, |
int16_t | nX, | ||
int16_t | nY, | ||
uint16_t | nW, | ||
gslc_tsColor | nCol | ||
) |
Draw a horizontal line.
[in] | pGui | Pointer to GUI |
[in] | nX | X coordinate of line startpoint |
[in] | nY | Y coordinate of line startpoint |
[in] | nW | Width of line (in +X direction) |
[in] | nCol | Color RGB value for the line |
void gslc_DrawLinePolar | ( | gslc_tsGui * | pGui, |
int16_t | nX, | ||
int16_t | nY, | ||
uint16_t | nRadStart, | ||
uint16_t | nRadEnd, | ||
int16_t | n64Ang, | ||
gslc_tsColor | nCol | ||
) |
Draw a polar ray segment.
[in] | pGui | Pointer to GUI |
[in] | nX | X coordinate of line startpoint |
[in] | nY | Y coordinate of line startpoint |
[in] | nRadStart | Starting radius of line |
[in] | nRadEnd | Ending radius of line |
[in] | n64Ang | Angle of ray (degrees * 64). 0 is up, +90*64 is to right From -180*64 to +180*64 |
[in] | nCol | Color RGB value for the line |
void gslc_DrawLineV | ( | gslc_tsGui * | pGui, |
int16_t | nX, | ||
int16_t | nY, | ||
uint16_t | nH, | ||
gslc_tsColor | nCol | ||
) |
Draw a vertical line.
[in] | pGui | Pointer to GUI |
[in] | nX | X coordinate of line startpoint |
[in] | nY | Y coordinate of line startpoint |
[in] | nH | Height of line (in +Y direction) |
[in] | nCol | Color RGB value for the line |
void gslc_DrawSetPixel | ( | gslc_tsGui * | pGui, |
int16_t | nX, | ||
int16_t | nY, | ||
gslc_tsColor | nCol | ||
) |
Set a pixel on the active screen to the given color with lock.
[in] | pGui | Pointer to GUI |
[in] | nX | Pixel X coordinate to set |
[in] | nY | Pixel Y coordinate to set |
[in] | nCol | Color pixel value to assign |