MPLABĀ® Harmony Graphics Suite
legato_renderer.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
29 #ifndef LEGATO_RENDERER_H
30 #define LEGATO_RENDERER_H
31 
36 #include "gfx/legato/image/legato_palette.h"
37 #include "gfx/driver/gfx_driver.h"
39 
40 
41 // *****************************************************************************
47 typedef enum leFrameState
48 {
49  LE_FRAME_READY = 0,
50  LE_FRAME_PREFRAME,
51  LE_FRAME_PRELAYER,
52  LE_FRAME_PRERECT,
53  LE_FRAME_PREWIDGET,
54  LE_FRAME_DRAWING,
55  LE_FRAME_POSTWIDGET,
56  LE_FRAME_POSTRECT,
57  LE_FRAME_WAITFORBUFFER,
58  LE_FRAME_POSTLAYER,
59  LE_FRAME_POSTFRAME,
61 
62 typedef struct leRenderLayerState
63 {
64  leRectArray prevDamageRects; // previous damaged rectangle list
65  leRectArray currentDamageRects; // queued damaged rectangle list
66  leRectArray pendingDamageRects; // pending damaged rectangle list
67  // these are rectangles added during
68  // a frame in progress
69 
70  leRectArray scratchRectList; // used for rectangle culling phase
71  leRectArray frameRectList; // rects to draw for a frame
72 
73  leBool drawingPrev; // indicates if the layer is currently
74  // drawing from its previous rectangle
75  // array
77 
83 typedef struct leRenderState
84 {
85  const gfxDisplayDriver* dispDriver; // the display driver pointer
86  const gfxGraphicsProcessor* gpuDriver; // the gpu driver pointer
87 
88  uint32_t layerIdx; // the current layer index
89 
90  //leRect displayRect; // the driver physical display rectangle
91  uint32_t bufferCount; // the number of scratch buffers the library supports
92 
93  uint32_t frameRectIdx; // the current frame draw rectangle index
94  leWidget* currentWidget; // the widget that is currently drawing
95 
96  leRect drawRect; // the current damage rectangle clipped
97  // to the currently rendering widget
98 
99  leRenderLayerState layerStates[LE_LAYER_COUNT];
100 
101  leFrameState frameState; // the current frame render state
102 
103  uint32_t drawCount; // the number of times the screen has drawn
104 
105  uint32_t frameDrawCount; // the number of widgets that have rendered
106  // on the screen
107 
108  uint32_t deltaTime; // stores delta time for updates that happen
109  // during rendering
110 
111 #if LE_ALPHA_BLENDING_ENABLED == 1
112  leBool alphaEnable; // the global alpha enabled flag
113  uint8_t alpha; // the current global alpha value
114 #endif
115 
116  lePalette* globalPalette; // the pointer to the global palette
117 
118  lePixelBuffer* renderBuffer; // the current scratch buffer
120 
121 typedef struct leGradient
122 {
123  leColor c0;
124  leColor c1;
125  leColor c2;
126  leColor c3;
127 } leGradient;
128 
129 /* internal use only */
134 leResult leRenderer_Initialize(const gfxDisplayDriver* dispDriver,
135  const gfxGraphicsProcessor* gpuDriver);
136 
137 // internal use only
138 void leRenderer_Shutdown();
145 // *****************************************************************************
146 /* Function:
147  leResult leRenderer_DamageArea(const leRect* rect)
148 
149  Summary:
150  Damages a section of a display layer. The renderer will redraw it as part
151  of the next draw cycle.
152 
153  Description:
154  Damages a section of a display layer. The renderer will redraw it as part
155  of the next draw cycle.
156 
157  Parameters:
158  const leRect* rect - the rectangle area to damage
159  uint32_t layerIdx - the layer to damage
160 
161  Returns:
162  leResult
163 */
164 leResult leRenderer_DamageArea(const leRect* rect, uint32_t layerIdx);
165 
166 // internal use only
167 void leRenderer_Paint();
168 
169 // *****************************************************************************
170 /* Function:
171  leRenderState* leGetRenderState();
172 
173  Summary:
174  Gets a pointer to the current render state. Use with caution.
175 
176  Description:
177  Gets a pointer to the current render state. Use with caution.
178 
179  Parameters:
180 
181  Returns:
182  leRenderState* - the current render state
183 */
184 leRenderState* leGetRenderState();
185 
186 // *****************************************************************************
187 /* Function:
188  leColorMode leRenderer_CurrentColorMode();
189 
190  Summary:
191  Gets the color mode of the current rendering layer.
192 
193  Description:
194  Gets the color mode of the current rendering layer.
195 
196  Parameters:
197 
198  Returns:
199  leColorMode - the current render color mode
200 */
201 leColorMode leRenderer_CurrentColorMode();
202 
203 // *****************************************************************************
204 /* Function:
205  lePalette* leRenderer_GetGlobalPalette()
206 
207  Summary:
208  Gets a pointer to the active global palette.
209 
210  Description:
211  Gets a pointer to the active global palette.
212 
213  Parameters:
214 
215  Returns:
216  lePalette* - the current global palette
217 */
218 lePalette* leRenderer_GetGlobalPalette();
219 
220 // *****************************************************************************
221 /* Function:
222  leResult leRenderer_SetGlobalPalette(lePalette* pal)
223 
224  Summary:
225  Sets the global palette to the given pointer.
226 
227  Description:
228  Sets the global palette to the given pointer.
229 
230  Parameters:
231  lePalette* pal - the palette to set
232 
233  Returns:
234  leResult
235 */
236 leResult leRenderer_SetGlobalPalette(lePalette* pal);
237 
238 // *****************************************************************************
239 /* Function:
240  leColor leRenderer_GlobalPaletteLookup(uint32_t idx)
241 
242  Summary:
243  Queries the global palette for a lookup value.
244 
245  Description:
246  Queries the global palette for a lookup value.
247 
248  Parameters:
249  uint32_t idx - index to query
250 
251  Returns:
252  leColor - the result color
253 */
254 leColor leRenderer_GlobalPaletteLookup(uint32_t idx);
255 
256 // *****************************************************************************
257 /* Function:
258  leColor leRenderer_ConvertColor(leColor inColor, leColorMode inMode)
259 
260  Summary:
261  Converts a color from the input mode to the current layer render color.
262 
263  Description:
264  Converts a color from the input mode to the current layer render color.
265 
266  Parameters:
267  leColor inColor - the input color
268  leColorMode inMode - the color mode of the input
269 
270  Returns:
271  leColor - the result color
272 */
273 leColor leRenderer_ConvertColor(leColor inColor, leColorMode inMode);
274 
275 // *****************************************************************************
276 /* Function:
277  leRect leRenderer_GetDrawRect()
278 
279  Summary:
280  Gets the current draw rectangle.
281 
282  Description:
283  Gets the current draw rectangle.
284 
285  Parameters:
286 
287  Returns:
288  leRect - the draw rectangle
289 */
290 leRect leRenderer_GetDrawRect();
291 
292 // *****************************************************************************
293 /* Function:
294  leBool leRenderer_CullDrawRect(const leRect* rect)
295 
296  Summary:
297  Attempts to cull a rectangle against the current draw rectangle.
298 
299  Description:
300  Attempts to cull a rectangle against the current draw rectangle.
301 
302  Parameters:
303  const leRect* rect - rectangle to cull (screen space)
304 
305  Returns:
306  leBool - LE_TRUE if the rectangle is outside of the draw rectangle
307 */
308 leBool leRenderer_CullDrawRect(const leRect* rect);
309 
310 // *****************************************************************************
311 /* Function:
312  leRenderer_CullDrawXY(int32_t x, int32_t y)
313 
314  Summary:
315  Attempts to cull a point against the current draw rectangle.
316 
317  Description:
318  Attempts to cull a point against the current draw rectangle.
319 
320  Parameters:
321  int32_t x - the x component of the point to cull (screen space)
322  int32_t y - the y component of the point to cull (screen space)
323 
324  Returns:
325  leBool - LE_TRUE if the point is outside of the draw rectangle
326 */
327 leBool leRenderer_CullDrawXY(int32_t x, int32_t y);
328 
329 // *****************************************************************************
330 /* Function:
331  leBool leRenderer_CullDrawPoint(const lePoint* pt)
332 
333  Summary:
334  Attempts to cull a point against the current draw rectangle.
335 
336  Description:
337  Attempts to cull a point against the current draw rectangle.
338 
339  Parameters:
340  const lePoint* pt - the point to cull (screen space)
341 
342  Returns:
343  leBool - LE_TRUE if the point is outside of the draw rectangle
344 */
345 leBool leRenderer_CullDrawPoint(const lePoint* pt);
346 
347 // *****************************************************************************
348 /* Function:
349  void leRenderer_ClipDrawRect(const leRect* rect, leRect* res)
350 
351  Summary:
352  Clips a rectangle against the current draw rectangle.
353 
354  Description:
355  Clips a rectangle against the current draw rectangle.
356 
357  Parameters:
358  const leRect* rect - rectangle to clip (screen space)
359  leRect* res - the clip result (screen space)
360 
361  Returns:
362  void
363 */
364 void leRenderer_ClipDrawRect(const leRect* rect, leRect* res);
365 
366 // *****************************************************************************
367 /* Function:
368  leColor leRenderer_GetPixel(int32_t x, int32_t y)
369 
370  Summary:
371  Reads a pixel from the current render buffer. Does not do bounds checking.
372 
373  Description:
374  Reads a pixel from the current render buffer. Does not do bounds checking.
375 
376  Parameters:
377  int32_t x - the x component of the point to cull (screen space)
378  int32_t y - the y component of the point to cull (screen space)
379 
380  Returns:
381  leColor - the color that was read
382 */
383 leColor leRenderer_GetPixel(int32_t x,
384  int32_t y);
385 
386 // *****************************************************************************
387 /* Function:
388  leResult leRenderer_GetPixel_Safe(int32_t x,
389  int32_t y,
390  leColor* clr)
391 
392  Summary:
393  Safely reads a pixel from the current render buffer.
394 
395  Description:
396  Safely reads a pixel from the current render buffer.
397 
398  Parameters:
399  int32_t x - the x component of the point to read (screen space)
400  int32_t y - the y component of the point to read (screen space)
401  leColor* clr - the color that was read
402 
403  Returns:
404  leResult - LE_TRUE if the point could be read
405 */
406 leResult leRenderer_GetPixel_Safe(int32_t x,
407  int32_t y,
408  leColor* clr);
409 
410 // *****************************************************************************
411 /* Function:
412  leResult leRenderer_PutPixel(int32_t x,
413  int32_t y,
414  leColor clr)
415 
416  Summary:
417  Writes a pixel to the current render buffer. Does not do bounds checking.
418 
419  Description:
420  Writes a pixel to the current render buffer. Does not do bounds checking.
421 
422  Parameters:
423  int32_t x - the x component of the point to write (screen space)
424  int32_t y - the y component of the point to write (screen space)
425  leColor clr - the color to write
426 
427  Returns:
428  leResult
429 */
430 leResult leRenderer_PutPixel(int32_t x,
431  int32_t y,
432  leColor clr);
433 
434 // *****************************************************************************
435 /* Function:
436  leResult leRenderer_BlendPixel(int32_t x,
437  int32_t y,
438  leColor clr,
439  uint32_t a)
440 
441  Summary:
442  Writes a pixel to the current render buffer. Does not do bounds checking.
443 
444  Description:
445  Writes a pixel to the current render buffer. Does not do bounds checking.
446 
447  Parameters:
448  int32_t x - the x component of the point to write (screen space)
449  int32_t y - the y component of the point to write (screen space)
450  leColor clr - the color to write
451  uint32_t a - the global alpha blending value to use
452 
453  Returns:
454  leResult
455 */
456 leResult leRenderer_BlendPixel(int32_t x,
457  int32_t y,
458  leColor clr,
459  uint32_t a);
460 
461 // *****************************************************************************
462 /* Function:
463  leResult leRenderer_PutPixel_Safe(int32_t x,
464  int32_t y,
465  leColor clr)
466 
467  Summary:
468  Safely writes a pixel to the current render buffer.
469 
470  Description:
471  Safely writes a pixel to the current render buffer.
472 
473  Parameters:
474  int32_t x - the x component of the point to write (screen space)
475  int32_t y - the y component of the point to write (screen space)
476  leColor clr - the color to write
477 
478  Returns:
479  leResult
480 */
481 leResult leRenderer_PutPixel_Safe(int32_t x,
482  int32_t y,
483  leColor clr);
484 
485 // *****************************************************************************
486 /* Function:
487  leResult leRenderer_BlendPixel_Safe(int32_t x,
488  int32_t y,
489  leColor clr,
490  uint32_t a)
491 
492  Summary:
493  Safely writes a pixel to the current render buffer.
494 
495  Description:
496  Safely writes a pixel to the current render buffer.
497 
498  Parameters:
499  int32_t x - the x component of the point to write (screen space)
500  int32_t y - the y component of the point to write (screen space)
501  leColor clr - the color to write
502  uint32_t a - the global alpha blending value to use
503 
504  Returns:
505  leResult
506 */
507 leResult leRenderer_BlendPixel_Safe(int32_t x,
508  int32_t y,
509  leColor clr,
510  uint32_t a);
511 
512 // *****************************************************************************
513 /* Function:
514  leResult leRenderer_FillArea(int32_t x,
515  int32_t y,
516  uint32_t width,
517  uint32_t height,
518  leColor clr,
519  uint32_t a)
520 
521  Summary:
522  Fills an area of the buffer with a single color. Does not do bounds
523  checking.
524 
525  Description:
526  Fills an area of the buffer with a single color. Does not do bounds
527  checking.
528 
529  Parameters:
530  int32_t x - the x component of the area to fill (screen space)
531  int32_t y - the y component of the area to fill (screen space)
532  uint32_t width - the width of the area
533  uint32_t height - the height of the area
534  leColor clr - the color to write
535  uint32_t a - the global alpha blending value to use
536 
537  Returns:
538  leResult
539 */
540 leResult leRenderer_FillArea(int32_t x,
541  int32_t y,
542  uint32_t width,
543  uint32_t height,
544  leColor clr,
545  uint32_t a);
546 
547 // *****************************************************************************
548 /* Function:
549  leResult leRenderer_FillArea_Safe(int32_t x,
550  int32_t y,
551  uint32_t width,
552  uint32_t height,
553  leColor clr,
554  uint32_t a)
555 
556  Summary:
557  Fills an area of the buffer with a single color.
558 
559  Description:
560  Fills an area of the buffer with a single color.
561 
562  Parameters:
563  int32_t x - the x component of the area to fill (screen space)
564  int32_t y - the y component of the area to fill (screen space)
565  uint32_t width - the width of the area
566  uint32_t height - the height of the area
567  leColor clr - the color to write
568  uint32_t a - the global alpha blending value to use
569 
570  Returns:
571  leResult
572 */
573 leResult leRenderer_FillArea_Safe(int32_t x,
574  int32_t y,
575  uint32_t width,
576  uint32_t height,
577  leColor clr,
578  uint32_t a);
579 
580 // *****************************************************************************
581 /* Function:
582  leResult leRenderer_HorzLine(int32_t x,
583  int32_t y,
584  int32_t w,
585  leColor clr,
586  uint32_t a)
587 
588  Summary:
589  Draws a horizontal line.
590 
591  Description:
592  Draws a horizontal line.
593 
594  Parameters:
595  int32_t x - the x component of the line (screen space)
596  int32_t y - the y component of the line (screen space)
597  uint32_t w - the width of the line
598  leColor clr - the color to write
599  uint32_t a - the global alpha blending value to use
600 
601  Returns:
602  leResult
603 */
604 leResult leRenderer_HorzLine(int32_t x,
605  int32_t y,
606  int32_t w,
607  leColor clr,
608  uint32_t a);
609 
610 // *****************************************************************************
611 /* Function:
612  leResult leRenderer_VertLine(int32_t x,
613  int32_t y,
614  int32_t h,
615  leColor clr,
616  uint32_t a)
617 
618  Summary:
619  Draws a vertical line.
620 
621  Description:
622  Draws a vertical line.
623 
624  Parameters:
625  int32_t x - the x component of the line (screen space)
626  int32_t y - the y component of the line (screen space)
627  uint32_t h - the height of the line
628  leColor clr - the color to write
629  uint32_t a - the global alpha blending value to use
630 
631  Returns:
632  leResult
633 */
634 leResult leRenderer_VertLine(int32_t x,
635  int32_t y,
636  int32_t h,
637  leColor clr,
638  uint32_t a);
639 
640 // *****************************************************************************
641 /* Function:
642  leResult leRenderer_DrawLine(int32_t x0,
643  int32_t y0,
644  int32_t x1,
645  int32_t y1,
646  leColor clr,
647  uint32_t a)
648 
649  Summary:
650  Draws a line.
651 
652  Description:
653  Draws a line.
654 
655  Parameters:
656  int32_t x0 - the start x component of the line (screen space)
657  int32_t y0 - the start y component of the line (screen space)
658  int32_t x1 - the end x component of the line (screen space)
659  int32_t y1 - the end y component of the line (screen space)
660  leColor clr - the color to write
661  uint32_t a - the global alpha blending value to use
662 
663  Returns:
664  leResult
665 */
666 leResult leRenderer_DrawLine(int32_t x0,
667  int32_t y0,
668  int32_t x1,
669  int32_t y1,
670  leColor clr,
671  uint32_t a);
672 
673 // *****************************************************************************
674 /* Function:
675  leResult leRenderer_RectLine(const leRect* rect,
676  leColor clr,
677  uint32_t a)
678 
679  Summary:
680  Draws an outline rectangle.
681 
682  Description:
683  Draws an outline rectangle.
684 
685  Parameters:
686  const leRect* rect - the rectangle to draw (screen space)
687  leColor clr - the color to write
688  uint32_t a - the global alpha blending value to use
689 
690  Returns:
691  leResult
692 */
693 leResult leRenderer_RectLine(const leRect* rect,
694  leColor clr,
695  uint32_t a);
696 
697 // *****************************************************************************
698 /* Function:
699  leResult leRenderer_RectFill(const leRect* rect,
700  leColor clr,
701  uint32_t a)
702 
703  Summary:
704  Draws a filled rectangle.
705 
706  Description:
707  Draws a filled rectangle.
708 
709  Parameters:
710  const leRect* rect - the rectangle to draw (screen space)
711  leColor clr - the color to write
712  uint32_t a - the global alpha blending value to use
713 
714  Returns:
715  leResult
716 */
717 leResult leRenderer_RectFill(const leRect* rect,
718  leColor clr,
719  uint32_t a);
720 
721 // *****************************************************************************
722 /* Function:
723  leResult leRenderer_HorzGradientRect(const leRect* rect,
724  leColor clr1,
725  leColor clr2,
726  uint32_t a)
727 
728  Summary:
729  Draws a horizontal gradient filled rectangle.
730 
731  Description:
732  Draws a horizontal gradient filled rectangle.
733 
734  Parameters:
735  const leRect* rect - the rectangle to draw (screen space)
736  leColor clr1 - the start color
737  leColor clr2 - the end color
738  uint32_t a - the global alpha blending value to use
739 
740  Returns:
741  leResult
742 */
743 leResult leRenderer_HorzGradientRect(const leRect* rect,
744  leColor clr1,
745  leColor clr2,
746  uint32_t a);
747 
748 // *****************************************************************************
749 /* Function:
750  leResult leRenderer_VertGradientRect(const leRect* rect,
751  leColor clr1,
752  leColor clr2,
753  uint32_t a)
754 
755  Summary:
756  Draws a vertical gradient filled rectangle.
757 
758  Description:
759  Draws a vertical gradient filled rectangle.
760 
761  Parameters:
762  const leRect* rect - the rectangle to draw (screen space)
763  leColor clr1 - the start color
764  leColor clr2 - the end color
765  uint32_t a - the global alpha blending value to use
766 
767  Returns:
768  leResult
769 */
770 leResult leRenderer_VertGradientRect(const leRect* rect,
771  leColor clr1,
772  leColor clr2,
773  uint32_t a);
774 
775 // *****************************************************************************
776 /* Function:
777  leResult leRenderer_CircleDraw(const leRect* rect,
778  int32_t x,
779  int32_t y,
780  uint32_t radius,
781  uint32_t thickness,
782  leColor clr,
783  uint32_t alpha)
784 
785  Summary:
786  Draws a circle outline.
787 
788  Description:
789  Draws a circle outline.
790 
791  Parameters:
792  const leRect* rect - the bounds of the circle area (screen space)
793  int32_t x - the x component of the origin (bound space)
794  int32_t y - the y component of the origin (bound space)
795  uint32_t radius - the radius of the circle
796  uint32_t thickness - the thickness of the circle
797  leColor clr - the color to write
798  uint32_t a - the global alpha blending value to use
799 
800  Returns:
801  leResult
802 */
803 leResult leRenderer_CircleDraw(const leRect* rect,
804  uint32_t thickness,
805  leColor clr,
806  uint32_t alpha);
807 
808 // *****************************************************************************
809 /* Function:
810  leResult leRenderer_CircleDraw(const leRect* rect,
811  int32_t x,
812  int32_t y,
813  uint32_t radius,
814  uint32_t thickness,
815  leColor clr,
816  uint32_t alpha)
817 
818  Summary:
819  Draws a filled circle.
820 
821  Description:
822  Draws a filled circle.
823 
824  Parameters:
825  const leRect* rect - the bounds of the circle area (screen space)
826  int32_t x - the x component of the origin (bound space)
827  int32_t y - the y component of the origin (bound space)
828  uint32_t radius - the radius of the circle
829  uint32_t thickness - the thickness of the circle
830  leColor borderClr - the outline color to write
831  leColor fillClr - the fill color to write
832  uint32_t a - the global alpha blending value to use
833 
834  Returns:
835  leResult
836 */
837 leResult leRenderer_CircleFill(const leRect* rect,
838  uint32_t thickness,
839  leColor borderClr,
840  leColor fillClr,
841  uint32_t alpha);
842 
843 // *****************************************************************************
844 /* Function:
845  leResult leRenderer_ArcLine(int32_t x,
846  int32_t y,
847  int32_t r,
848  int32_t startAngle,
849  int32_t centerAngle,
850  leColor clr,
851  uint32_t a)
852 
853  Summary:
854  Draws an arc line.
855 
856  Description:
857  Draws an arc line.
858 
859  Parameters:
860  int32_t x - the x component of the origin (screen space)
861  int32_t y - the y component of the origin (screen space)
862  uint32_t radius - the radius of the arc
863  uint32_t startAngle - the arc starting angle
864  uint32_t centerAngle - the arc center angle
865  leColor clr - the color to write
866  uint32_t a - the global alpha blending value to use
867 
868  Returns:
869  leResult
870 */
871 leResult leRenderer_ArcLine(int32_t x,
872  int32_t y,
873  int32_t radius,
874  int32_t startAngle,
875  int32_t centerAngle,
876  leColor clr,
877  uint32_t a);
878 
879 // *****************************************************************************
880 /* Function:
881  leResult leRenderer_ArcFill(const leRect* drawRect,
882  int32_t startAngle,
883  int32_t centerAngle,
884  uint32_t thickness,
885  leBool rounded,
886  leColor clr,
887  leBool antialias,
888  uint32_t a)
889 
890  Summary:
891  Draws a filled arc.
892 
893  Description:
894  Draws a filled arc.
895 
896  Parameters:
897  const leRect* drawRect - the bounds of the arc (screen space)
898  int32_t x - the x component of the origin (bound space)
899  int32_t y - the y component of the origin (bound space)
900  uint32_t radius - the radius of the arc
901  uint32_t startAngle - the arc starting angle
902  uint32_t spanAngle - the arc span/center angle
903  leBool rounded - indicates that the arc should draw rounded ends
904  leColor clr - the color to write
905  leBool antialias - indicates that an antialiased arc should be drawn (not supported yet)
906  uint32_t a - the global alpha blending value to use
907 
908  Returns:
909  leResult
910 */
911 leResult leRenderer_ArcFill(const leRect* drawRect,
912  int32_t startAngle,
913  int32_t spanAngle,
914  uint32_t thickness,
915  leBool rounded,
916  leColor clr,
917  leBool antialias,
918  uint32_t a);
919 
920 // *****************************************************************************
921 /* Function:
922  leResult leRenderer_EllipseLine(int32_t x,
923  int32_t y,
924  int32_t a,
925  int32_t b,
926  int32_t theta,
927  int32_t startAngle,
928  int32_t endAngle,
929  leColor clr,
930  uint32_t alpha)
931 
932  Summary:
933  Draws an ellipse.
934 
935  Description:
936  Draws an ellipse.
937 
938  Parameters:
939  int32_t x - the x component of the ellipse origin (screen space)
940  int32_t y - the y component of the ellipse origin (screen space)
941  int32_t a - the major axis component of the ellipse
942  int32_t b - the minor axis component of the ellipse
943  int32_t theta - the rotation component of the ellipse
944  int32_t startAngle - the starting angle
945  int32_t centerAngle - the center angle
946  leColor clr - the color to write
947  uint32_t alpha - the global alpha blending value to use
948 
949  Returns:
950  leResult
951 */
952 leResult leRenderer_EllipseLine(int32_t x,
953  int32_t y,
954  int32_t a,
955  int32_t b,
956  int32_t theta,
957  int32_t startAngle,
958  int32_t endAngle,
959  leColor clr,
960  uint32_t alpha);
961 
967 #endif // LEGATO_RENDERER_H
leColorModeInfo::size
uint32_t size
Definition: legato_color.h:215
leResult
leResult
This enum represents function call results.
Definition: legato_common.h:134
leRenderState
struct leRenderState leRenderState
This structs represents global state of the renderer.
leColorMode
leColorMode
This enum represents the supported RGB color formats.
Definition: legato_color.h:146
leRect
This struct represents a rectangle.
Definition: legato_common.h:405
lePixelBuffer_IsLocked
LIB_EXPORT leBool lePixelBuffer_IsLocked(const lePixelBuffer *const buffer)
Determines the lock state.
Definition: legato_pixelbuffer.c:470
leArray::size
uint32_t size
Definition: legato_array.h:63
leGetLayerColorMode
LIB_EXPORT leColorMode leGetLayerColorMode(uint32_t lyrIdx)
Get layer color mode.
Definition: legato_state.c:394
legato_pixelbuffer.h
Pixel Buffer functions and definitions.
leEvent
This enum presents a event. An event contains valid event ids.
Definition: legato_event.h:88
leRectArray::rects
leRect * rects
Definition: legato_rectarray.h:72
leRectArray_RemoveDuplicates
LIB_EXPORT leResult leRectArray_RemoveDuplicates(leRectArray *arr)
Removes any duplicate rectangles from an array.
Definition: legato_rectarray.c:258
leGradient
Definition: legato_renderer.h:122
legato_renderer.h
leSize::width
int32_t width
Definition: legato_common.h:382
leRectArray_MergeSimilar
LIB_EXPORT leResult leRectArray_MergeSimilar(leRectArray *arr)
Merge rectangles.
Definition: legato_rectarray.c:371
leRectIntersects
LIB_EXPORT leBool leRectIntersects(const leRect *l_rect, const leRect *r_rect)
Determines if two rectangles are intersecting.
Definition: legato_rect.c:51
leArray
This struct represents a array.
Definition: legato_array.h:61
leRectArray_RemoveOverlapping
LIB_EXPORT leResult leRectArray_RemoveOverlapping(leRectArray *arr)
Remove overlappping rectangles.
Definition: legato_rectarray.c:393
leRectArray_RemoveAt
LIB_EXPORT leResult leRectArray_RemoveAt(leRectArray *arr, uint32_t idx)
Removes a rectangle from the array at an index.
Definition: legato_rectarray.c:199
legato_widget.h
Legato widget definitions.
leRectArray
This struct represents a rectange array.
Definition: legato_rectarray.h:71
leRectCombine
LIB_EXPORT leRect leRectCombine(const leRect *l_rect, const leRect *r_rect)
Combine rectangles.
Definition: legato_rect.c:61
leArray::values
void ** values
Definition: legato_array.h:62
leRenderLayerState
Definition: legato_renderer.h:63
leBool
leBool
This enum represents booleans.
Definition: legato_common.h:157
legato_rectarray.h
An array implementation for storing rectangles for the Legato user interface library.
leRectArray_Create
LIB_EXPORT leResult leRectArray_Create(leRectArray *arr)
Creates a new rectangle.
Definition: legato_rectarray.c:82
leRectContainsRect
LIB_EXPORT leBool leRectContainsRect(const leRect *l_rect, const leRect *r_rect)
Determines if a rectangle is completely inside another rectangle.
Definition: legato_rect.c:40
leRectArray_SortByX
LIB_EXPORT leResult leRectArray_SortByX(leRectArray *arr)
Sort array by X coordinate.
Definition: legato_rectarray.c:311
leRectArray_SortByY
LIB_EXPORT leResult leRectArray_SortByY(leRectArray *arr)
Sort array by Y coordinate.
Definition: legato_rectarray.c:341
leRectArray_Clear
LIB_EXPORT leResult leRectArray_Clear(leRectArray *arr)
Removes all values from a given array.
Definition: legato_rectarray.c:230
LE_WIDGET_EVENT_PAINT
@ LE_WIDGET_EVENT_PAINT
Definition: legato_event.h:74
LE_FALSE
@ LE_FALSE
Definition: legato_common.h:158
leRectContainsPoint
LIB_EXPORT leBool leRectContainsPoint(const leRect *rect, const lePoint *point)
Determines if a point is inside a rectangle.
Definition: legato_rect.c:31
leGetLayerRenderHorizontal
leBool leGetLayerRenderHorizontal(uint32_t lyrIdx)
Get layer render direction.
Definition: legato_state.c:413
legato_utils.h
General internal utilities for the library.
leRectArray_CropToSizeX
leResult leRectArray_CropToSizeX(leRectArray *arr, uint32_t size)
Slices an array of rectangles to a given pixel count.
Definition: legato_rectarray.c:487
leWidget
Used to define a widget.
Definition: legato_widget.h:623
lePalette
This struct represents a palette asset.
Definition: legato_palette.h:70
legato_rect.h
Rectangle functions and definitions.
leRectClip
LIB_EXPORT void leRectClip(const leRect *l_rect, const leRect *r_rect, leRect *result)
Clips a rectangle to the space of another rectangle.
Definition: legato_rect.c:122
leColorConvert
LIB_EXPORT leColor leColorConvert(leColorMode mode_in, leColorMode mode_out, leColor color)
Convert to color value.
Definition: legato_color_convert.c:579
leState
This struct represents the state of the library.
Definition: legato_state.h:69
leRenderState
This structs represents global state of the renderer.
Definition: legato_renderer.h:84
leRectArray_Destroy
LIB_EXPORT leResult leRectArray_Destroy(leRectArray *arr)
Destroy array.
Definition: legato_rectarray.c:240
leState::rootWidget
leWidget rootWidget[LE_LAYER_COUNT]
Definition: legato_state.h:83
leRectArray::size
uint32_t size
Definition: legato_rectarray.h:73
leFrameState
leFrameState
This enum represents state of the renderer.
Definition: legato_renderer.h:48
LE_TRUE
@ LE_TRUE
Definition: legato_common.h:159
legato_common.h
Common macros and definitions used by Legato.
leRectSplit
LIB_EXPORT uint32_t leRectSplit(const leRect *sub, const leRect *obj, leRect res[4])
Split rectangles.
Definition: legato_rect.c:198
legato_state.h
leRectArray_PushBack
LIB_EXPORT leResult leRectArray_PushBack(leRectArray *arr, const leRect *rect)
Push value on back.
Definition: legato_rectarray.c:149
leRectArray_CropToSizeY
leResult leRectArray_CropToSizeY(leRectArray *arr, uint32_t size)
Slices an array of rectangles to a given pixel count.
Definition: legato_rectarray.c:447
leSize::height
int32_t height
Definition: legato_common.h:383
leRectArray_Copy
LIB_EXPORT leResult leRectArray_Copy(leRectArray *src, leRectArray *dest)
Copy array.
Definition: legato_rectarray.c:209
leColorInfoTable
const leColorModeInfo leColorInfoTable[]
This array represents information reference table.
Definition: legato_color.c:29
lePoint
This structure represents a integer Cartesian point.
Definition: legato_common.h:357
lePixelBuffer
Definition: legato_pixelbuffer.h:91