SDL  2.0
SDL_blendline.c
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "../../SDL_internal.h"
22 
23 #if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
24 
25 #include "SDL_draw.h"
26 #include "SDL_blendline.h"
27 #include "SDL_blendpoint.h"
28 
29 
30 static void
31 SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2,
32  SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
33  SDL_bool draw_end)
34 {
35  const SDL_PixelFormat *fmt = dst->format;
36  unsigned r, g, b, a, inva;
37 
39  r = DRAW_MUL(_r, _a);
40  g = DRAW_MUL(_g, _a);
41  b = DRAW_MUL(_b, _a);
42  a = _a;
43  } else {
44  r = _r;
45  g = _g;
46  b = _b;
47  a = _a;
48  }
49  inva = (a ^ 0xff);
50 
51  if (y1 == y2) {
52  switch (blendMode) {
55  break;
56  case SDL_BLENDMODE_ADD:
58  break;
59  case SDL_BLENDMODE_MOD:
61  break;
62  case SDL_BLENDMODE_MUL:
64  break;
65  default:
66  HLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
67  break;
68  }
69  } else if (x1 == x2) {
70  switch (blendMode) {
73  break;
74  case SDL_BLENDMODE_ADD:
76  break;
77  case SDL_BLENDMODE_MOD:
79  break;
80  case SDL_BLENDMODE_MUL:
82  break;
83  default:
84  VLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
85  break;
86  }
87  } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
88  switch (blendMode) {
91  break;
92  case SDL_BLENDMODE_ADD:
94  break;
95  case SDL_BLENDMODE_MOD:
97  break;
98  case SDL_BLENDMODE_MUL:
100  break;
101  default:
102  DLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
103  break;
104  }
105  } else {
106  switch (blendMode) {
107  case SDL_BLENDMODE_BLEND:
108  AALINE(x1, y1, x2, y2,
110  draw_end);
111  break;
112  case SDL_BLENDMODE_ADD:
113  AALINE(x1, y1, x2, y2,
115  draw_end);
116  break;
117  case SDL_BLENDMODE_MOD:
118  AALINE(x1, y1, x2, y2,
120  draw_end);
121  break;
122  case SDL_BLENDMODE_MUL:
123  AALINE(x1, y1, x2, y2,
125  draw_end);
126  break;
127  default:
128  AALINE(x1, y1, x2, y2,
130  draw_end);
131  break;
132  }
133  }
134 }
135 
136 static void
137 SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2,
138  SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
139  SDL_bool draw_end)
140 {
141  unsigned r, g, b, a, inva;
142 
144  r = DRAW_MUL(_r, _a);
145  g = DRAW_MUL(_g, _a);
146  b = DRAW_MUL(_b, _a);
147  a = _a;
148  } else {
149  r = _r;
150  g = _g;
151  b = _b;
152  a = _a;
153  }
154  inva = (a ^ 0xff);
155 
156  if (y1 == y2) {
157  switch (blendMode) {
158  case SDL_BLENDMODE_BLEND:
160  break;
161  case SDL_BLENDMODE_ADD:
163  break;
164  case SDL_BLENDMODE_MOD:
166  break;
167  case SDL_BLENDMODE_MUL:
169  break;
170  default:
171  HLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
172  break;
173  }
174  } else if (x1 == x2) {
175  switch (blendMode) {
176  case SDL_BLENDMODE_BLEND:
178  break;
179  case SDL_BLENDMODE_ADD:
181  break;
182  case SDL_BLENDMODE_MOD:
184  break;
185  case SDL_BLENDMODE_MUL:
187  break;
188  default:
189  VLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
190  break;
191  }
192  } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
193  switch (blendMode) {
194  case SDL_BLENDMODE_BLEND:
196  break;
197  case SDL_BLENDMODE_ADD:
199  break;
200  case SDL_BLENDMODE_MOD:
202  break;
203  case SDL_BLENDMODE_MUL:
205  break;
206  default:
207  DLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
208  break;
209  }
210  } else {
211  switch (blendMode) {
212  case SDL_BLENDMODE_BLEND:
213  AALINE(x1, y1, x2, y2,
215  draw_end);
216  break;
217  case SDL_BLENDMODE_ADD:
218  AALINE(x1, y1, x2, y2,
220  draw_end);
221  break;
222  case SDL_BLENDMODE_MOD:
223  AALINE(x1, y1, x2, y2,
225  draw_end);
226  break;
227  case SDL_BLENDMODE_MUL:
228  AALINE(x1, y1, x2, y2,
230  draw_end);
231  break;
232  default:
233  AALINE(x1, y1, x2, y2,
235  draw_end);
236  break;
237  }
238  }
239 }
240 
241 static void
242 SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2,
243  SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
244  SDL_bool draw_end)
245 {
246  unsigned r, g, b, a, inva;
247 
249  r = DRAW_MUL(_r, _a);
250  g = DRAW_MUL(_g, _a);
251  b = DRAW_MUL(_b, _a);
252  a = _a;
253  } else {
254  r = _r;
255  g = _g;
256  b = _b;
257  a = _a;
258  }
259  inva = (a ^ 0xff);
260 
261  if (y1 == y2) {
262  switch (blendMode) {
263  case SDL_BLENDMODE_BLEND:
265  break;
266  case SDL_BLENDMODE_ADD:
268  break;
269  case SDL_BLENDMODE_MOD:
271  break;
272  case SDL_BLENDMODE_MUL:
274  break;
275  default:
276  HLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
277  break;
278  }
279  } else if (x1 == x2) {
280  switch (blendMode) {
281  case SDL_BLENDMODE_BLEND:
283  break;
284  case SDL_BLENDMODE_ADD:
286  break;
287  case SDL_BLENDMODE_MOD:
289  break;
290  case SDL_BLENDMODE_MUL:
292  break;
293  default:
294  VLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
295  break;
296  }
297  } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
298  switch (blendMode) {
299  case SDL_BLENDMODE_BLEND:
301  break;
302  case SDL_BLENDMODE_ADD:
304  break;
305  case SDL_BLENDMODE_MOD:
307  break;
308  case SDL_BLENDMODE_MUL:
310  break;
311  default:
312  DLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
313  break;
314  }
315  } else {
316  switch (blendMode) {
317  case SDL_BLENDMODE_BLEND:
318  AALINE(x1, y1, x2, y2,
320  draw_end);
321  break;
322  case SDL_BLENDMODE_ADD:
323  AALINE(x1, y1, x2, y2,
325  draw_end);
326  break;
327  case SDL_BLENDMODE_MOD:
328  AALINE(x1, y1, x2, y2,
330  draw_end);
331  break;
332  case SDL_BLENDMODE_MUL:
333  AALINE(x1, y1, x2, y2,
335  draw_end);
336  break;
337  default:
338  AALINE(x1, y1, x2, y2,
340  draw_end);
341  break;
342  }
343  }
344 }
345 
346 static void
347 SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
348  SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
349  SDL_bool draw_end)
350 {
351  const SDL_PixelFormat *fmt = dst->format;
352  unsigned r, g, b, a, inva;
353 
355  r = DRAW_MUL(_r, _a);
356  g = DRAW_MUL(_g, _a);
357  b = DRAW_MUL(_b, _a);
358  a = _a;
359  } else {
360  r = _r;
361  g = _g;
362  b = _b;
363  a = _a;
364  }
365  inva = (a ^ 0xff);
366 
367  if (y1 == y2) {
368  switch (blendMode) {
369  case SDL_BLENDMODE_BLEND:
371  break;
372  case SDL_BLENDMODE_ADD:
373  HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
374  break;
375  case SDL_BLENDMODE_MOD:
376  HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
377  break;
378  case SDL_BLENDMODE_MUL:
379  HLINE(Uint32, DRAW_SETPIXEL_MUL_RGB, draw_end);
380  break;
381  default:
382  HLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
383  break;
384  }
385  } else if (x1 == x2) {
386  switch (blendMode) {
387  case SDL_BLENDMODE_BLEND:
389  break;
390  case SDL_BLENDMODE_ADD:
391  VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
392  break;
393  case SDL_BLENDMODE_MOD:
394  VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
395  break;
396  case SDL_BLENDMODE_MUL:
397  VLINE(Uint32, DRAW_SETPIXEL_MUL_RGB, draw_end);
398  break;
399  default:
400  VLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
401  break;
402  }
403  } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
404  switch (blendMode) {
405  case SDL_BLENDMODE_BLEND:
407  break;
408  case SDL_BLENDMODE_ADD:
409  DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
410  break;
411  case SDL_BLENDMODE_MOD:
412  DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
413  break;
414  case SDL_BLENDMODE_MUL:
415  DLINE(Uint32, DRAW_SETPIXEL_MUL_RGB, draw_end);
416  break;
417  default:
418  DLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
419  break;
420  }
421  } else {
422  switch (blendMode) {
423  case SDL_BLENDMODE_BLEND:
424  AALINE(x1, y1, x2, y2,
426  draw_end);
427  break;
428  case SDL_BLENDMODE_ADD:
429  AALINE(x1, y1, x2, y2,
431  draw_end);
432  break;
433  case SDL_BLENDMODE_MOD:
434  AALINE(x1, y1, x2, y2,
436  draw_end);
437  break;
438  case SDL_BLENDMODE_MUL:
439  AALINE(x1, y1, x2, y2,
441  draw_end);
442  break;
443  default:
444  AALINE(x1, y1, x2, y2,
446  draw_end);
447  break;
448  }
449  }
450 }
451 
452 static void
453 SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
454  SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
455  SDL_bool draw_end)
456 {
457  const SDL_PixelFormat *fmt = dst->format;
458  unsigned r, g, b, a, inva;
459 
461  r = DRAW_MUL(_r, _a);
462  g = DRAW_MUL(_g, _a);
463  b = DRAW_MUL(_b, _a);
464  a = _a;
465  } else {
466  r = _r;
467  g = _g;
468  b = _b;
469  a = _a;
470  }
471  inva = (a ^ 0xff);
472 
473  if (y1 == y2) {
474  switch (blendMode) {
475  case SDL_BLENDMODE_BLEND:
477  break;
478  case SDL_BLENDMODE_ADD:
479  HLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
480  break;
481  case SDL_BLENDMODE_MOD:
482  HLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
483  break;
484  case SDL_BLENDMODE_MUL:
485  HLINE(Uint32, DRAW_SETPIXEL_MUL_RGBA, draw_end);
486  break;
487  default:
488  HLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
489  break;
490  }
491  } else if (x1 == x2) {
492  switch (blendMode) {
493  case SDL_BLENDMODE_BLEND:
495  break;
496  case SDL_BLENDMODE_ADD:
497  VLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
498  break;
499  case SDL_BLENDMODE_MOD:
500  VLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
501  break;
502  case SDL_BLENDMODE_MUL:
503  VLINE(Uint32, DRAW_SETPIXEL_MUL_RGBA, draw_end);
504  break;
505  default:
506  VLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
507  break;
508  }
509  } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
510  switch (blendMode) {
511  case SDL_BLENDMODE_BLEND:
513  break;
514  case SDL_BLENDMODE_ADD:
515  DLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
516  break;
517  case SDL_BLENDMODE_MOD:
518  DLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
519  break;
520  case SDL_BLENDMODE_MUL:
521  DLINE(Uint32, DRAW_SETPIXEL_MUL_RGBA, draw_end);
522  break;
523  default:
524  DLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
525  break;
526  }
527  } else {
528  switch (blendMode) {
529  case SDL_BLENDMODE_BLEND:
530  AALINE(x1, y1, x2, y2,
532  draw_end);
533  break;
534  case SDL_BLENDMODE_ADD:
535  AALINE(x1, y1, x2, y2,
537  draw_end);
538  break;
539  case SDL_BLENDMODE_MOD:
540  AALINE(x1, y1, x2, y2,
542  draw_end);
543  break;
544  case SDL_BLENDMODE_MUL:
545  AALINE(x1, y1, x2, y2,
547  draw_end);
548  break;
549  default:
550  AALINE(x1, y1, x2, y2,
552  draw_end);
553  break;
554  }
555  }
556 }
557 
558 static void
559 SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
560  SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
561  SDL_bool draw_end)
562 {
563  unsigned r, g, b, a, inva;
564 
566  r = DRAW_MUL(_r, _a);
567  g = DRAW_MUL(_g, _a);
568  b = DRAW_MUL(_b, _a);
569  a = _a;
570  } else {
571  r = _r;
572  g = _g;
573  b = _b;
574  a = _a;
575  }
576  inva = (a ^ 0xff);
577 
578  if (y1 == y2) {
579  switch (blendMode) {
580  case SDL_BLENDMODE_BLEND:
582  break;
583  case SDL_BLENDMODE_ADD:
585  break;
586  case SDL_BLENDMODE_MOD:
588  break;
589  case SDL_BLENDMODE_MUL:
591  break;
592  default:
593  HLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
594  break;
595  }
596  } else if (x1 == x2) {
597  switch (blendMode) {
598  case SDL_BLENDMODE_BLEND:
600  break;
601  case SDL_BLENDMODE_ADD:
603  break;
604  case SDL_BLENDMODE_MOD:
606  break;
607  case SDL_BLENDMODE_MUL:
609  break;
610  default:
611  VLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
612  break;
613  }
614  } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
615  switch (blendMode) {
616  case SDL_BLENDMODE_BLEND:
618  break;
619  case SDL_BLENDMODE_ADD:
621  break;
622  case SDL_BLENDMODE_MOD:
624  break;
625  case SDL_BLENDMODE_MUL:
627  break;
628  default:
629  DLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
630  break;
631  }
632  } else {
633  switch (blendMode) {
634  case SDL_BLENDMODE_BLEND:
635  AALINE(x1, y1, x2, y2,
637  draw_end);
638  break;
639  case SDL_BLENDMODE_ADD:
640  AALINE(x1, y1, x2, y2,
642  draw_end);
643  break;
644  case SDL_BLENDMODE_MOD:
645  AALINE(x1, y1, x2, y2,
647  draw_end);
648  break;
649  case SDL_BLENDMODE_MUL:
650  AALINE(x1, y1, x2, y2,
652  draw_end);
653  break;
654  default:
655  AALINE(x1, y1, x2, y2,
657  draw_end);
658  break;
659  }
660  }
661 }
662 
663 static void
665  SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
666  SDL_bool draw_end)
667 {
668  unsigned r, g, b, a, inva;
669 
671  r = DRAW_MUL(_r, _a);
672  g = DRAW_MUL(_g, _a);
673  b = DRAW_MUL(_b, _a);
674  a = _a;
675  } else {
676  r = _r;
677  g = _g;
678  b = _b;
679  a = _a;
680  }
681  inva = (a ^ 0xff);
682 
683  if (y1 == y2) {
684  switch (blendMode) {
685  case SDL_BLENDMODE_BLEND:
687  break;
688  case SDL_BLENDMODE_ADD:
690  break;
691  case SDL_BLENDMODE_MOD:
693  break;
694  case SDL_BLENDMODE_MUL:
696  break;
697  default:
698  HLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
699  break;
700  }
701  } else if (x1 == x2) {
702  switch (blendMode) {
703  case SDL_BLENDMODE_BLEND:
705  break;
706  case SDL_BLENDMODE_ADD:
708  break;
709  case SDL_BLENDMODE_MOD:
711  break;
712  case SDL_BLENDMODE_MUL:
714  break;
715  default:
716  VLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
717  break;
718  }
719  } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
720  switch (blendMode) {
721  case SDL_BLENDMODE_BLEND:
723  break;
724  case SDL_BLENDMODE_ADD:
726  break;
727  case SDL_BLENDMODE_MOD:
729  break;
730  case SDL_BLENDMODE_MUL:
732  break;
733  default:
734  DLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
735  break;
736  }
737  } else {
738  switch (blendMode) {
739  case SDL_BLENDMODE_BLEND:
740  AALINE(x1, y1, x2, y2,
742  draw_end);
743  break;
744  case SDL_BLENDMODE_ADD:
745  AALINE(x1, y1, x2, y2,
747  draw_end);
748  break;
749  case SDL_BLENDMODE_MOD:
750  AALINE(x1, y1, x2, y2,
752  draw_end);
753  break;
754  case SDL_BLENDMODE_MUL:
755  AALINE(x1, y1, x2, y2,
757  draw_end);
758  break;
759  default:
760  AALINE(x1, y1, x2, y2,
762  draw_end);
763  break;
764  }
765  }
766 }
767 
769  int x1, int y1, int x2, int y2,
771  Uint8 r, Uint8 g, Uint8 b, Uint8 a,
772  SDL_bool draw_end);
773 
774 static BlendLineFunc
776 {
777  switch (fmt->BytesPerPixel) {
778  case 2:
779  if (fmt->Rmask == 0x7C00) {
780  return SDL_BlendLine_RGB555;
781  } else if (fmt->Rmask == 0xF800) {
782  return SDL_BlendLine_RGB565;
783  } else {
784  return SDL_BlendLine_RGB2;
785  }
786  /* break; -Wunreachable-code-break */
787  case 4:
788  if (fmt->Rmask == 0x00FF0000) {
789  if (fmt->Amask) {
790  return SDL_BlendLine_ARGB8888;
791  } else {
792  return SDL_BlendLine_RGB888;
793  }
794  } else {
795  if (fmt->Amask) {
796  return SDL_BlendLine_RGBA4;
797  } else {
798  return SDL_BlendLine_RGB4;
799  }
800  }
801  }
802  return NULL;
803 }
804 
805 int
806 SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
808 {
810 
811  if (!dst) {
812  return SDL_SetError("SDL_BlendLine(): Passed NULL destination surface");
813  }
814 
816  if (!func) {
817  return SDL_SetError("SDL_BlendLine(): Unsupported surface format");
818  }
819 
820  /* Perform clipping */
821  /* FIXME: We don't actually want to clip, as it may change line slope */
822  if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
823  return 0;
824  }
825 
826  func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, SDL_TRUE);
827  return 0;
828 }
829 
830 int
833 {
834  int i;
835  int x1, y1;
836  int x2, y2;
837  SDL_bool draw_end;
839 
840  if (!dst) {
841  return SDL_SetError("SDL_BlendLines(): Passed NULL destination surface");
842  }
843 
845  if (!func) {
846  return SDL_SetError("SDL_BlendLines(): Unsupported surface format");
847  }
848 
849  for (i = 1; i < count; ++i) {
850  x1 = points[i-1].x;
851  y1 = points[i-1].y;
852  x2 = points[i].x;
853  y2 = points[i].y;
854 
855  /* Perform clipping */
856  /* FIXME: We don't actually want to clip, as it may change line slope */
857  if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
858  continue;
859  }
860 
861  /* Draw the end if it was clipped */
862  draw_end = (x2 != points[i].x || y2 != points[i].y);
863 
864  func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, draw_end);
865  }
866  if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
868  blendMode, r, g, b, a);
869  }
870  return 0;
871 }
872 
873 #endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */
874 
875 /* vi: set ts=4 sw=4 expandtab: */
DLINE
#define DLINE(type, op, draw_end)
Definition: SDL_draw.h:396
points
GLfixed GLfixed GLint GLint GLfixed points
Definition: SDL_opengl_glext.h:4561
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
ABS
#define ABS(_x)
Definition: SDL_draw.h:349
DRAW_SETPIXELXY4_MUL_RGB
#define DRAW_SETPIXELXY4_MUL_RGB(x, y)
Definition: SDL_draw.h:303
SDL_blendline.h
DRAW_SETPIXEL_ARGB8888
#define DRAW_SETPIXEL_ARGB8888
Definition: SDL_draw.h:219
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:323
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
blendMode
static SDL_BlendMode blendMode
Definition: testdraw2.c:34
DRAW_SETPIXELXY_ARGB8888
#define DRAW_SETPIXELXY_ARGB8888(x, y)
Definition: SDL_draw.h:238
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:71
DRAW_SETPIXEL_RGB
#define DRAW_SETPIXEL_RGB
Definition: SDL_draw.h:257
SDL_BlendLine_RGB565
static void SDL_BlendLine_RGB565(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end)
Definition: SDL_blendline.c:242
NULL
#define NULL
Definition: begin_code.h:167
SDL_PixelFormat::format
Uint32 format
Definition: SDL_pixels.h:320
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
DRAW_SETPIXELXY4_BLEND_RGBA
#define DRAW_SETPIXELXY4_BLEND_RGBA(x, y)
Definition: SDL_draw.h:333
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1112
DRAW_SETPIXEL_MUL_RGB555
#define DRAW_SETPIXEL_MUL_RGB555
Definition: SDL_draw.h:120
DRAW_SETPIXELXY2_MUL_RGB
#define DRAW_SETPIXELXY2_MUL_RGB(x, y)
Definition: SDL_draw.h:300
DRAW_SETPIXELXY_MUL_RGB888
#define DRAW_SETPIXELXY_MUL_RGB888(x, y)
Definition: SDL_draw.h:212
SDL_BlendLine_RGB888
static void SDL_BlendLine_RGB888(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end)
Definition: SDL_blendline.c:559
count
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
SDL_BLENDMODE_BLEND
@ SDL_BLENDMODE_BLEND
Definition: SDL_blendmode.h:44
DRAW_SETPIXEL_BLEND_ARGB8888
#define DRAW_SETPIXEL_BLEND_ARGB8888
Definition: SDL_draw.h:222
DRAW_SETPIXEL_BLEND_RGB888
#define DRAW_SETPIXEL_BLEND_RGB888
Definition: SDL_draw.h:184
DRAW_SETPIXELXY4_RGB
#define DRAW_SETPIXELXY4_RGB(x, y)
Definition: SDL_draw.h:279
DRAW_SETPIXELXY_MUL_ARGB8888
#define DRAW_SETPIXELXY_MUL_ARGB8888(x, y)
Definition: SDL_draw.h:250
DRAW_SETPIXELXY2_ADD_RGB
#define DRAW_SETPIXELXY2_ADD_RGB(x, y)
Definition: SDL_draw.h:288
DRAW_SETPIXEL_MUL_RGB565
#define DRAW_SETPIXEL_MUL_RGB565
Definition: SDL_draw.h:158
SDL_BlendLine
int SDL_BlendLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_blendline.c:806
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
DRAW_SETPIXEL_MUL_RGB888
#define DRAW_SETPIXEL_MUL_RGB888
Definition: SDL_draw.h:196
DRAW_SETPIXEL_BLEND_RGB555
#define DRAW_SETPIXEL_BLEND_RGB555
Definition: SDL_draw.h:108
DRAW_SETPIXEL_BLEND_RGB565
#define DRAW_SETPIXEL_BLEND_RGB565
Definition: SDL_draw.h:146
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
DRAW_SETPIXELXY2_RGB
#define DRAW_SETPIXELXY2_RGB(x, y)
Definition: SDL_draw.h:276
DRAW_SETPIXEL_RGB555
#define DRAW_SETPIXEL_RGB555
Definition: SDL_draw.h:105
SDL_PixelFormat::Rmask
Uint32 Rmask
Definition: SDL_pixels.h:325
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8586
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112
SDL_BlendLines
int SDL_BlendLines(SDL_Surface *dst, const SDL_Point *points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_blendline.c:831
func
GLenum func
Definition: SDL_opengl_glext.h:660
DRAW_SETPIXEL_BLEND_RGBA
#define DRAW_SETPIXEL_BLEND_RGBA
Definition: SDL_draw.h:314
SDL_BlendLine_RGBA4
static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end)
Definition: SDL_blendline.c:453
DRAW_SETPIXELXY_RGB888
#define DRAW_SETPIXELXY_RGB888(x, y)
Definition: SDL_draw.h:200
DRAW_SETPIXEL_ADD_RGB
#define DRAW_SETPIXEL_ADD_RGB
Definition: SDL_draw.h:264
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1740
DRAW_SETPIXEL_MOD_ARGB8888
#define DRAW_SETPIXEL_MOD_ARGB8888
Definition: SDL_draw.h:230
DRAW_SETPIXEL_MUL_RGB
#define DRAW_SETPIXEL_MUL_RGB
Definition: SDL_draw.h:272
DRAW_SETPIXELXY_ADD_RGB555
#define DRAW_SETPIXELXY_ADD_RGB555(x, y)
Definition: SDL_draw.h:130
DRAW_SETPIXELXY4_MUL_RGBA
#define DRAW_SETPIXELXY4_MUL_RGBA(x, y)
Definition: SDL_draw.h:342
DRAW_SETPIXEL_MOD_RGB888
#define DRAW_SETPIXEL_MOD_RGB888
Definition: SDL_draw.h:192
DRAW_SETPIXELXY_ADD_RGB565
#define DRAW_SETPIXELXY_ADD_RGB565(x, y)
Definition: SDL_draw.h:168
DRAW_SETPIXELXY2_MOD_RGB
#define DRAW_SETPIXELXY2_MOD_RGB(x, y)
Definition: SDL_draw.h:294
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
VLINE
#define VLINE(type, op, draw_end)
Definition: SDL_draw.h:374
DRAW_SETPIXELXY4_MOD_RGBA
#define DRAW_SETPIXELXY4_MOD_RGBA(x, y)
Definition: SDL_draw.h:339
AALINE
#define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end)
Definition: SDL_draw.h:593
SDL_draw.h
SDL_blendpoint.h
DRAW_SETPIXEL_RGB565
#define DRAW_SETPIXEL_RGB565
Definition: SDL_draw.h:143
DRAW_SETPIXELXY_MOD_RGB888
#define DRAW_SETPIXELXY_MOD_RGB888(x, y)
Definition: SDL_draw.h:209
DRAW_SETPIXEL_ADD_RGB888
#define DRAW_SETPIXEL_ADD_RGB888
Definition: SDL_draw.h:188
DRAW_SETPIXELXY4_ADD_RGB
#define DRAW_SETPIXELXY4_ADD_RGB(x, y)
Definition: SDL_draw.h:291
DRAW_SETPIXELXY_MOD_ARGB8888
#define DRAW_SETPIXELXY_MOD_ARGB8888(x, y)
Definition: SDL_draw.h:247
SDL_BlendPoint
int SDL_BlendPoint(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_blendpoint.c:217
DRAW_SETPIXEL_ADD_RGB565
#define DRAW_SETPIXEL_ADD_RGB565
Definition: SDL_draw.h:150
DRAW_SETPIXELXY_BLEND_ARGB8888
#define DRAW_SETPIXELXY_BLEND_ARGB8888(x, y)
Definition: SDL_draw.h:241
DRAW_SETPIXEL_MOD_RGB
#define DRAW_SETPIXEL_MOD_RGB
Definition: SDL_draw.h:268
DRAW_SETPIXELXY_ADD_ARGB8888
#define DRAW_SETPIXELXY_ADD_ARGB8888(x, y)
Definition: SDL_draw.h:244
DRAW_SETPIXEL_ADD_RGBA
#define DRAW_SETPIXEL_ADD_RGBA
Definition: SDL_draw.h:318
DRAW_SETPIXEL_MOD_RGB565
#define DRAW_SETPIXEL_MOD_RGB565
Definition: SDL_draw.h:154
SDL_PixelFormat::Amask
Uint32 Amask
Definition: SDL_pixels.h:328
BlendLineFunc
void(* BlendLineFunc)(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a, SDL_bool draw_end)
Definition: SDL_blendline.c:768
DRAW_SETPIXELXY_BLEND_RGB565
#define DRAW_SETPIXELXY_BLEND_RGB565(x, y)
Definition: SDL_draw.h:165
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
DRAW_SETPIXELXY_RGB555
#define DRAW_SETPIXELXY_RGB555(x, y)
Definition: SDL_draw.h:124
SDL_BlendLine_RGB4
static void SDL_BlendLine_RGB4(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end)
Definition: SDL_blendline.c:347
SDL_PixelFormat
Definition: SDL_pixels.h:319
DRAW_SETPIXEL_BLEND_RGB
#define DRAW_SETPIXEL_BLEND_RGB
Definition: SDL_draw.h:260
SDL_BLENDMODE_MUL
@ SDL_BLENDMODE_MUL
Definition: SDL_blendmode.h:53
DRAW_MUL
#define DRAW_MUL(_a, _b)
Definition: SDL_draw.h:29
DRAW_SETPIXELXY4_RGBA
#define DRAW_SETPIXELXY4_RGBA(x, y)
Definition: SDL_draw.h:330
DRAW_SETPIXELXY2_BLEND_RGB
#define DRAW_SETPIXELXY2_BLEND_RGB(x, y)
Definition: SDL_draw.h:282
DRAW_SETPIXELXY_MOD_RGB565
#define DRAW_SETPIXELXY_MOD_RGB565(x, y)
Definition: SDL_draw.h:171
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
DRAW_SETPIXELXY4_MOD_RGB
#define DRAW_SETPIXELXY4_MOD_RGB(x, y)
Definition: SDL_draw.h:297
DRAW_SETPIXEL_ADD_ARGB8888
#define DRAW_SETPIXEL_ADD_ARGB8888
Definition: SDL_draw.h:226
DRAW_SETPIXEL_MUL_RGBA
#define DRAW_SETPIXEL_MUL_RGBA
Definition: SDL_draw.h:326
DRAW_SETPIXEL_MOD_RGBA
#define DRAW_SETPIXEL_MOD_RGBA
Definition: SDL_draw.h:322
SDL_BlendLine_ARGB8888
static void SDL_BlendLine_ARGB8888(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end)
Definition: SDL_blendline.c:664
DRAW_SETPIXELXY_MOD_RGB555
#define DRAW_SETPIXELXY_MOD_RGB555(x, y)
Definition: SDL_draw.h:133
SDL_Point
The structure that defines a point (integer)
Definition: SDL_rect.h:49
DRAW_SETPIXELXY_MUL_RGB565
#define DRAW_SETPIXELXY_MUL_RGB565(x, y)
Definition: SDL_draw.h:174
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4586
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
DRAW_SETPIXELXY_BLEND_RGB888
#define DRAW_SETPIXELXY_BLEND_RGB888(x, y)
Definition: SDL_draw.h:203
SDL_BlendLine_RGB555
static void SDL_BlendLine_RGB555(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end)
Definition: SDL_blendline.c:137
DRAW_SETPIXELXY4_BLEND_RGB
#define DRAW_SETPIXELXY4_BLEND_RGB(x, y)
Definition: SDL_draw.h:285
DRAW_SETPIXELXY_BLEND_RGB555
#define DRAW_SETPIXELXY_BLEND_RGB555(x, y)
Definition: SDL_draw.h:127
DRAW_SETPIXEL_RGBA
#define DRAW_SETPIXEL_RGBA
Definition: SDL_draw.h:311
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4586
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4586
DRAW_SETPIXELXY_RGB565
#define DRAW_SETPIXELXY_RGB565(x, y)
Definition: SDL_draw.h:162
SDL_CalculateBlendLineFunc
static BlendLineFunc SDL_CalculateBlendLineFunc(const SDL_PixelFormat *fmt)
Definition: SDL_blendline.c:775
DRAW_SETPIXELXY_ADD_RGB888
#define DRAW_SETPIXELXY_ADD_RGB888(x, y)
Definition: SDL_draw.h:206
HLINE
#define HLINE(type, op, draw_end)
Definition: SDL_draw.h:352
SDL_IntersectRectAndLine
#define SDL_IntersectRectAndLine
Definition: SDL_dynapi_overrides.h:297
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:162
SDL_BlendLine_RGB2
static void SDL_BlendLine_RGB2(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end)
Definition: SDL_blendline.c:31
DRAW_SETPIXEL_RGB888
#define DRAW_SETPIXEL_RGB888
Definition: SDL_draw.h:181
DRAW_SETPIXELXY_MUL_RGB555
#define DRAW_SETPIXELXY_MUL_RGB555(x, y)
Definition: SDL_draw.h:136
void
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
Definition: SDL_dynapi_procs.h:89
SDL_BLENDMODE_MOD
@ SDL_BLENDMODE_MOD
Definition: SDL_blendmode.h:50
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
DRAW_SETPIXELXY4_ADD_RGBA
#define DRAW_SETPIXELXY4_ADD_RGBA(x, y)
Definition: SDL_draw.h:336
SDL_BLENDMODE_ADD
@ SDL_BLENDMODE_ADD
Definition: SDL_blendmode.h:47
SDL_BlendMode
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:41
DRAW_SETPIXEL_MOD_RGB555
#define DRAW_SETPIXEL_MOD_RGB555
Definition: SDL_draw.h:116
DRAW_SETPIXEL_ADD_RGB555
#define DRAW_SETPIXEL_ADD_RGB555
Definition: SDL_draw.h:112
DRAW_SETPIXEL_MUL_ARGB8888
#define DRAW_SETPIXEL_MUL_ARGB8888
Definition: SDL_draw.h:234