IPC@CHIP® Graphics Library – API Documentation

Header image

Main page


Drawing Functions

This section holds the intrinsic drawing functions. More...

Functions

GcErrorCode gcSetPen (const GcPen *pen)
 Set the current pen.
GcErrorCode gcSetBrush (const GcBrush *brush)
 Set the current brush.
GcErrorCode gcClear (GcImage *targetImage, GcColor color)
 Clear an image or the frame buffer.
GcErrorCode gcSetPixel (GcImage *targetImage, unsigned short x, unsigned short y, GcColor color)
 Set color of a single pixel.
GcErrorCode gcGetPixel (GcImage *targetImage, unsigned short x, unsigned short y, GcColor *color)
 Get color of a single pixel.
GcErrorCode gcDrawLine (GcImage *targetImage, unsigned short xStart, unsigned short yStart, unsigned short xEnd, unsigned short yEnd)
 Draw a line.
GcErrorCode gcDrawRoundRect (GcImage *targetImage, unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned short radius)
 Draw a rectangle with round corners.
GcErrorCode gcDrawRect (GcImage *targetImage, unsigned short x, unsigned short y, unsigned short width, unsigned short height)
 Draw the edges of a rectangle.
GcErrorCode gcFillRoundRect (GcImage *targetImage, unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned short radius)
 Fill a rectangle with round corners.
GcErrorCode gcFillRect (GcImage *targetImage, unsigned short x, unsigned short y, unsigned short width, unsigned short height)
 Fill a rectangle.
GcErrorCode gcDrawCircle (GcImage *targetImage, unsigned short centerX, unsigned short centerY, unsigned short radius)
 Draw the edge of a circle.
GcErrorCode gcFillCircle (GcImage *targetImage, unsigned short centerX, unsigned short centerY, unsigned short radius)
 Fill a circle.
GcErrorCode gcDrawPolygon (GcImage *targetImage, const unsigned short *xs, const unsigned short *ys, unsigned short nPoints)
 Draw the edge of a polygon.
GcErrorCode gcFillPolygon (GcImage *targetImage, const unsigned short *xs, const unsigned short *ys, unsigned short nPoints)
 Fill a polygon.
GcErrorCode gcDrawEllipse (GcImage *targetImage, unsigned short centerX, unsigned short centerY, unsigned short radiusX, unsigned short radiusY)
 Draw the edge of an ellipse.
GcErrorCode gcFillEllipse (GcImage *targetImage, unsigned short centerX, unsigned short centerY, unsigned short radiusX, unsigned short radiusY)
 Fill an ellipse.
GcErrorCode gcDrawImage (GcImage *targetImage, unsigned short x, unsigned short y, GcImage *sourceImage)
 Draw an image.
GcErrorCode gcDrawImageEx (GcImage *targetImage, unsigned short xTarget, unsigned short yTarget, GcImage *sourceImage, unsigned short xSource, unsigned short ySource, unsigned short width, unsigned short height)
 Draw an image (extended).
GcErrorCode gcDrawText (GcImage *targetImage, unsigned short x, unsigned short y, const char *text)
 Draw a text.
GcErrorCode gcDrawTextFormat (GcImage *targetImage, unsigned short x, unsigned short y, const char *format,...)
 Format and draw a text.
GcErrorCode gcDrawTextFormatV (GcImage *targetImage, unsigned short x, unsigned short y, const char *format, va_list argumentList)
 Format and draw a text.
GcErrorCode gcDrawTextInRectangle (GcImage *targetImage, const char *text, unsigned short x0, unsigned short y0, unsigned short x1, unsigned short y1, long textAlign, long maxLen, GcRotation rotation)
 Format and draw a text.
GcErrorCode gcSetAAFactor (unsigned short factor)
 Set antialiasing factor for drawing functions.

Detailed Description

This section holds the intrinsic drawing functions provided by the IPC@CHIP® Graphics Library. The functions gcSetPen() and gcSetBrush() can be used to set the current pen and brush respectively. Pens hold the properties of the edges of geometric figures. Brushes hold the properties of the filling of geometric figures.
All other functions in this section can be used to for drawing. They all have their first parameter in common, which is named targetImage. Here you can pass a pointer to an object of the type GcImage. The drawing function will then operate on this image object, e.g. draw a rectangle onto the image. If you pass a NULL pointer here, the operation will not operate on an image object, but directly on the frame buffer. The frame buffer is a region in video memory, which holds the image that is being shown on the display. So, if you draw on the frame buffer, you directly modify what's on the display.
If double buffering is being used, there are two frame buffers, one is being shown on the display while the second is being drawn on. In this case you will not see what you have drawn onto the frame buffer before calling gcFlush().

All coordinates handed to drawing functions are interpreted as pixel coordinates. The coordinate system starts in the upper left corner of the screen.






Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Tue Jun 27 14:21:34 2017 by Doxygen 1.6.1