1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** GUIX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Display Management (Display) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_display.h" |
29 |
|
|
|
30 |
|
|
#if defined(GX_BRUSH_ALPHA_SUPPORT) |
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _gx_display_driver_horizontal_line_alpha_draw PORTABLE C */ |
37 |
|
|
/* 6.1 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* Internal helper function that draws an alpha blended horizontal */ |
45 |
|
|
/* line. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* context Drawing context */ |
50 |
|
|
/* xstart x-coord of left endpoint */ |
51 |
|
|
/* xend x-coord of right endpoint */ |
52 |
|
|
/* ypos y-coord of line top */ |
53 |
|
|
/* width Width (height) of the line */ |
54 |
|
|
/* color Color of line to write */ |
55 |
|
|
/* */ |
56 |
|
|
/* OUTPUT */ |
57 |
|
|
/* */ |
58 |
|
|
/* NOne */ |
59 |
|
|
/* */ |
60 |
|
|
/* CALLS */ |
61 |
|
|
/* */ |
62 |
|
|
/* [gx_display_driver_pixel_blend] Basic display driver pixel */ |
63 |
|
|
/* blend function */ |
64 |
|
|
/* */ |
65 |
|
|
/* CALLED BY */ |
66 |
|
|
/* */ |
67 |
|
|
/* _gx_display_driver_8bpp_horizontal_line_draw */ |
68 |
|
|
/* _gx_display_driver_16bpp_horizontal_line_draw */ |
69 |
|
|
/* _gx_display_driver_32bpp_horizontal_line_draw */ |
70 |
|
|
/* */ |
71 |
|
|
/**************************************************************************/ |
72 |
|
328222 |
VOID _gx_display_driver_horizontal_line_alpha_draw(GX_DRAW_CONTEXT *context, INT xstart, INT xend, INT ypos, INT width, GX_COLOR color, GX_UBYTE alpha) |
73 |
|
|
{ |
74 |
|
|
INT xval; |
75 |
|
|
INT yval; |
76 |
|
|
INT yend; |
77 |
|
|
VOID (*blend_func)(GX_DRAW_CONTEXT *context, INT x, INT y, GX_COLOR fcolor, GX_UBYTE alpha); |
78 |
|
|
|
79 |
|
328222 |
blend_func = context -> gx_draw_context_display -> gx_display_driver_pixel_blend; |
80 |
|
|
|
81 |
✓✓ |
328222 |
if (blend_func == GX_NULL) |
82 |
|
|
{ |
83 |
|
116 |
return; |
84 |
|
|
} |
85 |
|
328106 |
yend = ypos + width; |
86 |
|
|
|
87 |
|
|
/* draw 1-pixel hi lines to fill width */ |
88 |
✓✓ |
3531451 |
for (yval = ypos; yval < yend; yval++) |
89 |
|
|
{ |
90 |
|
|
/* draw one line, left to right */ |
91 |
✓✓ |
572820349 |
for (xval = xstart; xval <= xend; xval++) |
92 |
|
|
{ |
93 |
|
569617004 |
blend_func(context, xval, yval, color, alpha); |
94 |
|
|
} |
95 |
|
|
} |
96 |
|
|
} |
97 |
|
|
|
98 |
|
|
#endif /* GX_BRUSH_ALPHA_SUPPORT */ |
99 |
|
|
|