26 int32_t xCenter, int32_t yCenter,
27 int32_t x, int32_t y, uint8_t bitMask);
52 int32_t yCenter, uint32_t radius)
85 int32_t yCenter, uint32_t radius, uint8_t bitMask)
90 int32_t d = 1 - radius;
91 uint32_t drawnElements = 0;
99 if (status ==
GLIB_OK) drawnElements++;
108 d += 2 * (x - y) + 1;
115 if (status ==
GLIB_OK) drawnElements++;
143 int32_t yCenter, uint32_t radius)
148 int32_t d = 1 - radius;
149 uint32_t drawnElements = 0;
155 status =
GLIB_drawLineH(pContext, xCenter - y, yCenter, xCenter + y);
157 if (status ==
GLIB_OK) drawnElements++;
166 d += 2 * (x - y) + 1;
170 status =
GLIB_drawLineH(pContext, xCenter - x, yCenter + y, xCenter + x);
172 if (status ==
GLIB_OK) drawnElements++;
174 status =
GLIB_drawLineH(pContext, xCenter - y, yCenter + x, xCenter + y);
176 if (status ==
GLIB_OK) drawnElements++;
178 status =
GLIB_drawLineH(pContext, xCenter - x, yCenter - y, xCenter + x);
180 if (status ==
GLIB_OK) drawnElements++;
182 status =
GLIB_drawLineH(pContext, xCenter - y, yCenter - x, xCenter + y);
184 if (status ==
GLIB_OK) drawnElements++;
219 int32_t xCenter, int32_t yCenter,
220 int32_t x, int32_t y, uint8_t bitMask)
223 uint32_t drawnElements = 0;
227 int32_t xOffsets[] = {y, x, -x, -y, -y, -x, x, y};
228 int32_t yOffsets[] = {-x, -y, -y, -x, x, y, y, x};
236 status =
GLIB_drawPixel(pContext, xCenter + xOffsets[i], yCenter + yOffsets[i]);
238 if (status ==
GLIB_OK) drawnElements++;
EMSTATUS GLIB_drawCircle(GLIB_Context_t *pContext, int32_t xCenter, int32_t yCenter, uint32_t radius)
Draws a circle with center at x, y, and a radius.
#define GLIB_ERROR_NOTHING_TO_DRAW
static EMSTATUS GLIB_drawPartialCirclePoints(GLIB_Context_t *pContext, int32_t xCenter, int32_t yCenter, int32_t x, int32_t y, uint8_t bitMask)
Draws circle points using 8-way symmetry.
EMSTATUS GLIB_drawPartialCircle(GLIB_Context_t *pContext, int32_t xCenter, int32_t yCenter, uint32_t radius, uint8_t bitMask)
Draws a partial circle with center at x, y, and a radius.
#define GLIB_ERROR_INVALID_ARGUMENT
Silicon Labs Graphics Library.
EMSTATUS GLIB_drawCircleFilled(GLIB_Context_t *pContext, int32_t xCenter, int32_t yCenter, uint32_t radius)
Draws a filled circle with center at x, y, and a radius.
EMSTATUS GLIB_drawLineH(GLIB_Context_t *pContext, int32_t x1, int32_t y1, int32_t x2)
Draws a horizontal line from x1, y1 to x2, y2.
EMSTATUS GLIB_drawPixel(GLIB_Context_t *pContext, int32_t x, int32_t y)
Draws a pixel at x, y using foregroundColor defined in the GLIB_Context_t.
GLIB Drawing Context (Multiple instances of GLIB_Context_t can exist)