Hanna
Sourcecode Batteriemanagementsystem
gfx_generic.c
gehe zur Dokumentation dieser Datei
1 
45 /*
46  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
47  */
48 #include "gfx.h"
49 #include "compiler.h"
50 
53 
54 /* This function is documented in gfx.h */
55 void gfx_set_clipping ( gfx_coord_t min_x, gfx_coord_t min_y, gfx_coord_t max_x, gfx_coord_t max_y )
56 {
57 #ifdef CONF_GFX_USE_CLIPPING
58  /* Limit clipping region to within display panel boundaries. */
59  if ( min_x < 0 )
60  {
61  min_x = 0;
62  }
63 
64  if ( min_y < 0 )
65  {
66  min_y = 0;
67  }
68 
69  if ( max_x >= gfx_width )
70  {
71  max_x = gfx_width - 1;
72  }
73 
74  if ( max_y >= gfx_height )
75  {
76  max_y = gfx_height - 1;
77  }
78 
79  gfx_min_x = min_x;
80  gfx_min_y = min_y;
81  gfx_max_x = max_x;
82  gfx_max_y = max_y;
83 #endif
84 }
85 
86 gfx_coord_t gfx_get_width ( void )
87 {
88  return gfx_width;
89 }
90 
91 gfx_coord_t gfx_get_height ( void )
92 {
93  return gfx_height;
94 }
95 
96 /* This function is documented in gfx.h */
98 {
99  gfx_coord_t x2;
100  gfx_coord_t y2;
101 
102  if ( (width == 0) || (height == 0) )
103  {
104  return;
105  }
106 
107  /* Invert if width or height is negative. */
108  if ( width < 0 )
109  {
110  width = -width;
111  x -= width - 1;
112  }
113 
114  if ( height < 0 )
115  {
116  height = -height;
117  y -= height - 1;
118  }
119 
120 #ifdef CONF_GFX_USE_CLIPPING
121  /* Nothing to do if entire rectangle is outside clipping region. */
122  if ( (x > gfx_max_x) || (y > gfx_max_y) || ((x + width) <= gfx_min_x) || ((y + height) <= gfx_min_y) )
123  {
124  return;
125  }
126 
127  /* Clip if outside left X limit. */
128  if ( x < gfx_min_x )
129  {
130  width -= gfx_min_x - x;
131  x = gfx_min_x;
132  }
133 
134  /* Clip if outside top Y limit. */
135  if ( y < gfx_min_y )
136  {
137  height -= gfx_min_y - y;
138  y = gfx_min_y;
139  }
140 #endif
141 
142  /* Compute bottom right point. */
143  x2 = x + width - 1;
144  y2 = y + height - 1;
145 
146 #ifdef CONF_GFX_USE_CLIPPING
147  /* Clip if outside right X limit. */
148  if ( x2 > gfx_max_x )
149  {
150  x2 = gfx_max_x;
151  width = x2 - x + 1;
152  }
153 
154  /* Clip if outside bottom Y limit. */
155  if ( y2 > gfx_max_y )
156  {
157  y2 = gfx_max_y;
158  height = y2 - y + 1;
159  }
160 #endif
161 
162  /* Set up draw area and duplicate pixel color until area is full. */
163  gfx_set_limits( x, y, x2, y2 );
164  gfx_duplicate_pixel( color, (uint32_t )width * height );
165 }
166 
168 {
169  gfx_coord_t x;
170  gfx_coord_t y;
171  int16_t xinc;
172  int16_t yinc;
173  int16_t dx;
174  int16_t dy;
175 
176  /* Compute deltas, ie. "width" and "height" of line, then
177  * compute x and y direction, and make deltas positive for later use.
178  * Start off assuming direction is positive, ie. right and down.
179  */
180  xinc = 1;
181  dx = x2 - x1;
182  if ( dx < 0 )
183  {
184  xinc = -1;
185  dx = -dx;
186  }
187 
188  yinc = 1;
189  dy = y2 - y1;
190  if ( dy < 0 )
191  {
192  yinc = -1;
193  dy = -dy;
194  }
195 
196  /* Set up current point and prepare bottom right corner of draw area.*/
197  x = x1;
198  y = y1;
200 
201  /*
202  * A "flat" line (dx>dy) is handled differently from a "steep"
203  * line (dx<dy).
204  */
205  if ( dx > dy )
206  {
207  gfx_coord_t i;
208  int16_t e = dx >> 1;
209 
210  /* Walk along X, draw pixel, and step Y when required. */
211  for ( i = 0; i <= dx; ++i )
212  {
213  gfx_draw_line_pixel( x, y, color );
214 
215  /* Update fractional part ("error"),
216  * and step Y when it crosses 0.
217  */
218  e -= dy;
219  if ( e < 0 )
220  {
221  e += dx;
222  y += yinc;
223  }
224 
225  /* Walk one step along X.*/
226  x += xinc;
227  }
228  }
229  else
230  {
231  gfx_coord_t i;
232  int16_t e = dy >> 1;
233 
234  /* Walk along Y, draw pixel, and step X when required. */
235  for ( i = 0; i <= dy; ++i )
236  {
237  gfx_draw_line_pixel( x, y, color );
238 
239  /* Update fractional part ("error"),
240  * and step X when it crosses 0.
241  */
242  e -= dx;
243  if ( e < 0 )
244  {
245  e += dy;
246  x += xinc;
247  }
248 
249  /* Walk one step along Y. */
250  y += yinc;
251  }
252  }
253 }
254 
255 void gfx_generic_draw_circle ( gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, gfx_color_t color, uint8_t octant_mask )
256 {
257  gfx_coord_t offset_x;
258  gfx_coord_t offset_y;
259  int16_t error;
260 
261  /* Draw only a pixel if radius is zero. */
262  if ( radius == 0 )
263  {
264  gfx_draw_pixel( x, y, color );
265  return;
266  }
267 
268  /* Set up start iterators. */
269  offset_x = 0;
270  offset_y = radius;
271  error = 3 - 2 * radius;
272 
273  /* Iterate offsetX from 0 to radius. */
274  while ( offset_x <= offset_y )
275  {
276  /* Draw one pixel for each octant enabled in octant_mask. */
277  if ( octant_mask & GFX_OCTANT0 )
278  {
279  gfx_draw_pixel( x + offset_y, y - offset_x, color );
280  }
281 
282  if ( octant_mask & GFX_OCTANT1 )
283  {
284  gfx_draw_pixel( x + offset_x, y - offset_y, color );
285  }
286 
287  if ( octant_mask & GFX_OCTANT2 )
288  {
289  gfx_draw_pixel( x - offset_x, y - offset_y, color );
290  }
291 
292  if ( octant_mask & GFX_OCTANT3 )
293  {
294  gfx_draw_pixel( x - offset_y, y - offset_x, color );
295  }
296 
297  if ( octant_mask & GFX_OCTANT4 )
298  {
299  gfx_draw_pixel( x - offset_y, y + offset_x, color );
300  }
301 
302  if ( octant_mask & GFX_OCTANT5 )
303  {
304  gfx_draw_pixel( x - offset_x, y + offset_y, color );
305  }
306 
307  if ( octant_mask & GFX_OCTANT6 )
308  {
309  gfx_draw_pixel( x + offset_x, y + offset_y, color );
310  }
311 
312  if ( octant_mask & GFX_OCTANT7 )
313  {
314  gfx_draw_pixel( x + offset_y, y + offset_x, color );
315  }
316 
317  /* Update error value and step offset_y when required. */
318  if ( error < 0 )
319  {
320  error += ((offset_x << 2) + 6);
321  }
322  else
323  {
324  error += (((offset_x - offset_y) << 2) + 10);
325  --offset_y;
326  }
327 
328  /* Next X. */
329  ++offset_x;
330  }
331 }
332 
333 void gfx_generic_draw_filled_circle ( gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, gfx_color_t color, uint8_t quadrant_mask )
334 {
335  gfx_coord_t offset_x;
336  gfx_coord_t offset_y;
337  int16_t error;
338 
339  /* Draw only a pixel if radius is zero. */
340  if ( radius == 0 )
341  {
342  gfx_draw_pixel( x, y, color );
343  return;
344  }
345 
346  /* Set up start iterators. */
347  offset_x = 0;
348  offset_y = radius;
349  error = 3 - 2 * radius;
350 
351  /* Iterate offset_x from 0 to radius. */
352  while ( offset_x <= offset_y )
353  {
354  /* Draw vertical lines tracking each quadrant. */
355  if ( quadrant_mask & GFX_QUADRANT0 )
356  {
357  gfx_draw_vertical_line( x + offset_y, y - offset_x, offset_x + 1, color );
358  gfx_draw_vertical_line( x + offset_x, y - offset_y, offset_y + 1, color );
359  }
360 
361  if ( quadrant_mask & GFX_QUADRANT1 )
362  {
363  gfx_draw_vertical_line( x - offset_y, y - offset_x, offset_x + 1, color );
364  gfx_draw_vertical_line( x - offset_x, y - offset_y, offset_y + 1, color );
365  }
366 
367  if ( quadrant_mask & GFX_QUADRANT2 )
368  {
369  gfx_draw_vertical_line( x - offset_y, y, offset_x + 1, color );
370  gfx_draw_vertical_line( x - offset_x, y, offset_y + 1, color );
371  }
372 
373  if ( quadrant_mask & GFX_QUADRANT3 )
374  {
375  gfx_draw_vertical_line( x + offset_y, y, offset_x + 1, color );
376  gfx_draw_vertical_line( x + offset_x, y, offset_y + 1, color );
377  }
378 
379  /* Update error value and step offset_y when required. */
380  if ( error < 0 )
381  {
382  error += ((offset_x << 2) + 6);
383  }
384  else
385  {
386  error += (((offset_x - offset_y) << 2) + 10);
387  --offset_y;
388  }
389 
390  /* Next X. */
391  ++offset_x;
392  }
393 }
394 
396 {
397  gfx_coord_t x2;
398  gfx_coord_t y2;
399 
400  /* Nothing to do if width or height is zero. */
401  if ( (width == 0) || (height == 0) )
402  {
403  return;
404  }
405 
406  /* Sanity check on parameters. */
407  Assert( pixmap != 0 );
408  Assert( (map_x + width) <= map_width );
409  Assert( map_x >= 0 );
410  Assert( map_y >= 0 );
411  Assert( width > 0 );
412  Assert( height > 0 );
413 
414 #ifdef CONF_GFX_USE_CLIPPING
415  /* Nothing to do if entire rectangle is outside clipping region. */
416  if ( (x > gfx_max_x) || (y > gfx_max_y) || ((x + width) <= gfx_min_x) || ((y + height) <= gfx_min_y) )
417  {
418  return;
419  }
420 
421  /* Clip if outside left X limit. */
422  if ( x < gfx_min_x )
423  {
424  width -= gfx_min_x - x;
425  map_x += gfx_min_x - x;
426  x = gfx_min_x;
427  }
428 
429  /* Clip if outside top Y limit. */
430  if ( y < gfx_min_y )
431  {
432  height -= gfx_min_y - y;
433  map_y += gfx_min_y - y;
434  y = gfx_min_y;
435  }
436 #endif
437 
438  /* Compute bottom right point. */
439  x2 = x + width - 1;
440  y2 = y + height - 1;
441 
442 #ifdef CONF_GFX_USE_CLIPPING
443  /* Clip if outside right X limit. */
444  if ( x2 > gfx_max_x )
445  {
446  x2 = gfx_max_x;
447  width = x2 - x + 1;
448  }
449 
450  /* Clip if outside bottom Y limit. */
451  if ( y2 > gfx_max_y )
452  {
453  y2 = gfx_max_y;
454  height = y2 - y + 1;
455  }
456 #endif
457 
458  /* Offset into pixmap. */
459  pixmap += map_x;
460  if ( map_y > 0 )
461  {
462  pixmap += (uint32_t) map_y * map_width;
463  }
464 
465  /* Set up read area. */
466  gfx_set_bottom_right_limit( x2, y2 );
467 
468  /* In case of no horizontal pixmap clipping, easier handling is
469  * possible.
470  */
471  if ( (map_width == width) && (map_x == 0) )
472  {
473  gfx_set_top_left_limit( x, y );
474  gfx_copy_pixels_from_screen( pixmap, (uint32_t )width * height );
475  }
476  else
477  {
478  /* Copy line by line from screen. */
479  gfx_coord_t lines_left = height;
480 
481  while ( lines_left > 0 )
482  {
483  /* Set up read area. */
484  gfx_set_top_left_limit( x, y );
485  ++y;
486 
487  /* Get the pixels. */
488  gfx_copy_pixels_from_screen( pixmap, width );
489  pixmap += map_width;
490  --lines_left;
491  }
492  }
493 }
494 
495 void gfx_generic_put_pixmap ( const gfx_color_t *pixmap, gfx_coord_t map_width, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height )
496 {
497  gfx_coord_t x2;
498  gfx_coord_t y2;
499 
500  /* Nothing to do if width or height is zero. */
501  if ( (width == 0) || (height == 0) )
502  {
503  return;
504  }
505 
506  /* Sanity check on parameters. */
507  Assert( pixmap != 0 );
508  Assert( (map_x + width) <= map_width );
509  Assert( map_x >= 0 );
510  Assert( map_y >= 0 );
511  Assert( width > 0 );
512  Assert( height > 0 );
513 
514 #ifdef CONF_GFX_USE_CLIPPING
515  /* Nothing to do if entire rectangle is outside clipping region. */
516  if ( (x > gfx_max_x) || (y > gfx_max_y) || ((x + width) <= gfx_min_x) || ((y + height) <= gfx_min_y) )
517  {
518  return;
519  }
520 
521  /* Clip if outside left X limit. */
522  if ( x < gfx_min_x )
523  {
524  width -= gfx_min_x - x;
525  map_x += gfx_min_x - x;
526  x = gfx_min_x;
527  }
528 
529  /* Clip if outside top Y limit. */
530  if ( y < gfx_min_y )
531  {
532  height -= gfx_min_y - y;
533  map_y += gfx_min_y - y;
534  y = gfx_min_y;
535  }
536 #endif
537 
538  /* Compute bottom right point. */
539  x2 = x + width - 1;
540  y2 = y + height - 1;
541 
542 #ifdef CONF_GFX_USE_CLIPPING
543  /* Clip if outside right X limit. */
544  if ( x2 > gfx_max_x )
545  {
546  x2 = gfx_max_x;
547  width = x2 - x + 1;
548  }
549 
550  /* Clip if outside bottom Y limit. */
551  if ( y2 > gfx_max_y )
552  {
553  y2 = gfx_max_y;
554  height = y2 - y + 1;
555  }
556 #endif
557 
558  /* Offset into pixmap. */
559  pixmap += map_x;
560  if ( map_y > 0 )
561  {
562  pixmap += (uint32_t) map_y * map_width;
563  }
564 
565  /* Set up draw area. */
566  gfx_set_bottom_right_limit( x2, y2 );
567 
568  /* In case of no horizontal pixmap clipping, easier handling is
569  * possible.
570  */
571  if ( (map_width == width) && (map_x == 0) )
572  {
573  gfx_set_top_left_limit( x, y );
574  gfx_copy_pixels_to_screen( pixmap, (uint32_t )width * height );
575  }
576  else
577  {
578  gfx_coord_t lines_left = height;
579 
580  /* Copy line by line to screen. */
581  while ( lines_left > 0 )
582  {
583  /* Set up draw area. */
584  gfx_set_top_left_limit( x, y );
585  ++y;
586 
587  /* Do the pixel copying. */
588  gfx_copy_pixels_to_screen( pixmap, width );
589  pixmap += map_width;
590  --lines_left;
591  }
592  }
593 }
594 
595 void gfx_generic_draw_bitmap_tiled ( const struct gfx_bitmap *bmp, gfx_coord_t x1, gfx_coord_t y1, gfx_coord_t x2, gfx_coord_t y2, gfx_coord_t tile_origin_x, gfx_coord_t tile_origin_y )
596 {
597  gfx_coord_t map_width;
598  gfx_coord_t map_height;
599  gfx_coord_t start_x;
600  gfx_coord_t start_y;
601  gfx_coord_t index_x;
602  gfx_coord_t index_y;
603 
604  /* Sanity check on parameters. */
605  Assert( bmp );
606  Assert( x1 >= 0 );
607  Assert( y1 >= 0 );
608  Assert( x2 > x1 );
609  Assert( y2 > y1 );
610  Assert( tile_origin_x <= x1 );
611  Assert( tile_origin_y <= y1 );
612 
613  /* Faster handling for solid color bitmaps */
614  if ( bmp->type == GFX_BITMAP_SOLID )
615  {
616  gfx_draw_filled_rect( x1, y1, x2 - x1 + 1, y2 - y1 + 1, bmp->data.color );
617  return;
618  }
619 
620  /* Find starting position */
621  map_width = bmp->width;
622  map_height = bmp->height;
623  start_x = tile_origin_x;
624  start_y = tile_origin_y;
625 
626  while ( start_x <= (x1 - map_width) )
627  {
628  start_x += map_width;
629  }
630  while ( start_y <= (y1 - map_height) )
631  {
632  start_y += map_height;
633  }
634 
635  /* Draw tiles to cover the output area */
636  for ( index_y = start_y; index_y <= y2; index_y += map_height )
637  {
638  for ( index_x = start_x; index_x <= x2; index_x += map_width )
639  {
640  gfx_put_bitmap( bmp, 0, 0, index_x, index_y, map_width, map_height );
641  }
642  }
643 }
644 
645 void gfx_generic_put_bitmap ( const struct gfx_bitmap *bmp, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height )
646 {
647  gfx_coord_t x2;
648  gfx_coord_t y2;
649  gfx_coord_t map_width = bmp->width;
650  gfx_color_t *pixmap;
651 #if XMEGA
652  gfx_color_t PROGMEM_PTR_T progmem_pixmap;
653 #endif
654 
655  /* Nothing to do if width or height is zero. */
656  if ( (width == 0) || (height == 0) )
657  {
658  return;
659  }
660 
661  /* Sanity check on parameters. */
662  Assert( bmp );
663  Assert( (map_x + width) <= map_width );
664  Assert( map_x >= 0 );
665  Assert( map_y >= 0 );
666  Assert( width > 0 );
667  Assert( height > 0 );
668 
669 #ifdef CONF_GFX_USE_CLIPPING
670  /* Nothing to do if entire rectangle is outside clipping region. */
671  if ( (x > gfx_max_x) || (y > gfx_max_y) || ((x + width) <= gfx_min_x) || ((y + height) <= gfx_min_y) )
672  {
673  return;
674  }
675 
676  /* Clip if outside left X limit. */
677  if ( x < gfx_min_x )
678  {
679  width -= gfx_min_x - x;
680  map_x += gfx_min_x - x;
681  x = gfx_min_x;
682  }
683 
684  /* Clip if outside top Y limit. */
685  if ( y < gfx_min_y )
686  {
687  height -= gfx_min_y - y;
688  map_y += gfx_min_y - y;
689  y = gfx_min_y;
690  }
691 
692 #endif
693 
694  /* Compute bottom right point. */
695  x2 = x + width - 1;
696  y2 = y + height - 1;
697 
698 #ifdef CONF_GFX_USE_CLIPPING
699  /* Clip if outside right X limit. */
700  if ( x2 > gfx_max_x )
701  {
702  x2 = gfx_max_x;
703  width = x2 - x + 1;
704  }
705 
706  /* Clip if outside bottom Y limit. */
707  if ( y2 > gfx_max_y )
708  {
709  y2 = gfx_max_y;
710  height = y2 - y + 1;
711  }
712 #endif
713 
714  switch (bmp->type)
715  {
716  case GFX_BITMAP_SOLID:
717  gfx_draw_filled_rect( x, y, x2 - x, y2 - y, bmp->data.color );
718  break;
719 
720  case GFX_BITMAP_EXT:
721  /* Draw bitmap through external interface */
722  if ( gfx_ext_draw_func != NULL )
723  {
724  gfx_ext_draw_func ( bmp, x, y, x2 - x, y2 - y );
725  }
726  break;
727 
728  case GFX_BITMAP_RAM:
729 #if !XMEGA
730  case GFX_BITMAP_PROGMEM:
731 #endif
732  pixmap = bmp->data.pixmap;
733 
734  /* Offset into pixmap. */
735  pixmap += map_x;
736 
737  if ( map_y > 0 )
738  {
739  pixmap += (uint32_t) map_y * map_width;
740  }
741 
742  /* Set up draw area. */
743  gfx_set_bottom_right_limit( x2, y2 );
744 
745  /* In case of no horizontal pixmap clipping, easier handling is
746  * possible. */
747  if ( (map_width == width) && (map_x == 0) )
748  {
749  gfx_set_top_left_limit( x, y );
750  gfx_copy_pixels_to_screen( pixmap, (uint32_t )width * height );
751  }
752  else
753  {
754  gfx_coord_t lines_left = height;
755 
756  /* Copy line by line to screen. */
757  while ( lines_left > 0 )
758  {
759  /* Set up draw area. */
760  gfx_set_top_left_limit( x, y );
761  ++y;
762 
763  /* Do the pixel copying. */
764  gfx_copy_pixels_to_screen( pixmap, width );
765  pixmap += map_width;
766  --lines_left;
767  }
768  }
769 
770  break;
771 
772 #if XMEGA
773  case GFX_BITMAP_PROGMEM:
774  progmem_pixmap = bmp->data.progmem;
775 
776  /* Offset into pixmap. */
777  progmem_pixmap += map_x;
778 
779  if ( map_y > 0 )
780  {
781  progmem_pixmap += (uint32_t) map_y * map_width;
782  }
783 
784  /* Set up draw area. */
785  gfx_set_bottom_right_limit( x2, y2 );
786 
787  /* In case of no horizontal pixmap clipping, easier handling is
788  * possible.
789  */
790  if ( (map_width == width) && (map_x == 0) )
791  {
792  gfx_set_top_left_limit( x, y );
793  gfx_copy_progmem_pixels_to_screen( progmem_pixmap, (uint32_t )width * height, bmp->swap );
794  }
795  else
796  {
797  gfx_coord_t lines_left = height;
798 
799  /* Copy line by line to screen. */
800  while ( lines_left > 0 )
801  {
802  /* Set up draw area. */
803  gfx_set_top_left_limit( x, y );
804  ++y;
805 
806  /* Do the pixel copying. */
807  gfx_copy_progmem_pixels_to_screen( progmem_pixmap, width, bmp->swap );
808  progmem_pixmap += map_width;
809  --lines_left;
810  }
811  }
812 
813  break;
814 #endif
815  }
816 }
817 
819 {
820  gfx_ext_draw_func = gfx_ext_draw;
821 }
#define GFX_OCTANT0
Definition: gfx.h:124
Storage structure for bitmap pixel data and metadata.
Definition: gfx_generic.h:83
void gfx_generic_get_pixmap(gfx_color_t *pixmap, gfx_coord_t map_width, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
Definition: gfx_generic.c:395
#define gfx_draw_line_pixel(x, y, color)
Definition: gfx_ili9341.h:263
#define gfx_put_bitmap(bmp, map_x, map_y, x, y, width, height)
Definition: gfx_ili9341.h:216
void gfx_generic_draw_line(gfx_coord_t x1, gfx_coord_t y1, gfx_coord_t x2, gfx_coord_t y2, gfx_color_t color)
Definition: gfx_generic.c:167
#define GFX_OCTANT4
Definition: gfx.h:136
#define gfx_set_top_left_limit(x, y)
Definition: gfx_ili9341.h:270
#define GFX_OCTANT6
Definition: gfx.h:142
uint8_t swap
Definition: gfx_generic.h:89
gfx_coord_t gfx_width
Definition: gfx_ili9341.c:60
#define gfx_set_bottom_right_limit(x, y)
Definition: gfx_ili9341.h:276
Commonly used includes, types and macros.
#define Assert(expr)
This macro is used to test fatal errors.
Definition: compiler.h:46
void gfx_generic_put_pixmap(const gfx_color_t *pixmap, gfx_coord_t map_width, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
Definition: gfx_generic.c:495
gfx_coord_t gfx_height
Definition: gfx_ili9341.c:60
#define gfx_draw_pixel(x, y, color)
Definition: gfx_ili9341.h:257
gfx_coord_t gfx_max_y
Definition: gfx_ili9341.c:62
void gfx_generic_draw_bitmap_tiled(const struct gfx_bitmap *bmp, gfx_coord_t x1, gfx_coord_t y1, gfx_coord_t x2, gfx_coord_t y2, gfx_coord_t tile_origin_x, gfx_coord_t tile_origin_y)
Definition: gfx_generic.c:595
enum gfx_bitmap_type type
Definition: gfx_generic.h:91
gfx_color_t color
Definition: gfx_generic.h:94
#define GFX_OCTANT3
Definition: gfx.h:133
#define GFX_OCTANT7
Definition: gfx.h:145
#define GFX_QUADRANT1
Definition: gfx.h:151
static gfx_ext_draw_handler_t gfx_ext_draw_func
Definition: gfx_generic.c:52
gfx_coord_t gfx_max_x
Definition: gfx_ili9341.c:62
void(* gfx_ext_draw_handler_t)(struct gfx_bitmap const *bmp, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y)
Function pointer type for external bitmap draw handlers.
Definition: gfx_generic.h:113
#define GFX_QUADRANT0
Definition: gfx.h:148
void gfx_generic_set_ext_handler(gfx_ext_draw_handler_t gfx_ext_draw)
Definition: gfx_generic.c:818
#define GFX_QUADRANT3
Definition: gfx.h:157
gfx_coord_t height
Definition: gfx_generic.h:87
#define gfx_duplicate_pixel(color, count)
Definition: gfx_ili9341.h:245
gfx_coord_t gfx_min_x
Definition: gfx_ili9341.c:61
#define gfx_copy_progmem_pixels_to_screen(pixels, count, swap)
Definition: gfx_ili9341.h:302
gfx_color_t PROGMEM_PTR_T progmem
Definition: gfx_generic.h:98
ili9341_coord_t gfx_coord_t
Data type representing a coordinate on the screen.
Definition: gfx_ili9341.h:58
#define GFX_OCTANT1
Definition: gfx.h:127
#define gfx_copy_pixels_from_screen(pixels, count)
Definition: gfx_ili9341.h:295
#define GFX_QUADRANT2
Definition: gfx.h:154
gfx_color_t * pixmap
Definition: gfx_generic.h:96
Graphical library API header file.
#define GFX_OCTANT5
Definition: gfx.h:139
void gfx_generic_draw_filled_circle(gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, gfx_color_t color, uint8_t quadrant_mask)
Definition: gfx_generic.c:333
void gfx_generic_draw_filled_rect(gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height, gfx_color_t color)
Definition: gfx_generic.c:97
void gfx_generic_put_bitmap(const struct gfx_bitmap *bmp, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
Definition: gfx_generic.c:645
#define gfx_copy_pixels_to_screen(pixels, count)
Definition: gfx_ili9341.h:288
void gfx_generic_draw_circle(gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, gfx_color_t color, uint8_t octant_mask)
Definition: gfx_generic.c:255
#define gfx_draw_filled_rect(x, y, width, height, color)
Definition: gfx_ili9341.h:178
gfx_coord_t width
Definition: gfx_generic.h:85
#define gfx_set_limits(x1, y1, x2, y2)
Definition: gfx_ili9341.h:282
gfx_coord_t gfx_min_y
Definition: gfx_ili9341.c:61
#define GFX_OCTANT2
Definition: gfx.h:130
ili9341_color_t gfx_color_t
Data type for color values native to the display.
Definition: gfx_ili9341.h:57
#define gfx_draw_vertical_line(x, y, length, color)
Definition: gfx_ili9341.h:157