1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* |
4 |
|
|
* This program and the accompanying materials are made available under the |
5 |
|
|
* terms of the MIT License which is available at |
6 |
|
|
* https://opensource.org/licenses/MIT. |
7 |
|
|
* |
8 |
|
|
* SPDX-License-Identifier: MIT |
9 |
|
|
**************************************************************************/ |
10 |
|
|
|
11 |
|
|
|
12 |
|
|
/**************************************************************************/ |
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/** */ |
15 |
|
|
/** GUIX Component */ |
16 |
|
|
/** */ |
17 |
|
|
/** Display Management (Display) */ |
18 |
|
|
/** */ |
19 |
|
|
/**************************************************************************/ |
20 |
|
|
#define GX_SOURCE_CODE |
21 |
|
|
|
22 |
|
|
|
23 |
|
|
/* Include necessary system files. */ |
24 |
|
|
|
25 |
|
|
#include "gx_api.h" |
26 |
|
|
#include "gx_display.h" |
27 |
|
|
|
28 |
|
|
#if defined GX_BRUSH_ALPHA_SUPPORT |
29 |
|
|
/**************************************************************************/ |
30 |
|
|
/* */ |
31 |
|
|
/* FUNCTION RELEASE */ |
32 |
|
|
/* */ |
33 |
|
|
/* _gx_display_driver_vertical_line_alpha_draw PORTABLE C */ |
34 |
|
|
/* 6.1 */ |
35 |
|
|
/* AUTHOR */ |
36 |
|
|
/* */ |
37 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
38 |
|
|
/* */ |
39 |
|
|
/* DESCRIPTION */ |
40 |
|
|
/* */ |
41 |
|
|
/* Generic driver function that handles drawing vertical line with */ |
42 |
|
|
/* brush alpha. */ |
43 |
|
|
/* */ |
44 |
|
|
/* INPUT */ |
45 |
|
|
/* */ |
46 |
|
|
/* context Drawing context */ |
47 |
|
|
/* ystart y-coord of top endpoint */ |
48 |
|
|
/* yend y-coord of bottom endpoint */ |
49 |
|
|
/* xpos x-coord of left edge */ |
50 |
|
|
/* width width of the line */ |
51 |
|
|
/* color Color of line to write */ |
52 |
|
|
/* */ |
53 |
|
|
/* OUTPUT */ |
54 |
|
|
/* */ |
55 |
|
|
/* None */ |
56 |
|
|
/* */ |
57 |
|
|
/* CALLS */ |
58 |
|
|
/* */ |
59 |
|
|
/* [gx_display_driver_pixel_blend] Basic display driver pixel */ |
60 |
|
|
/* blend function */ |
61 |
|
|
/* */ |
62 |
|
|
/* CALLED BY */ |
63 |
|
|
/* */ |
64 |
|
|
/* _gx_display_driver_32bpp_vertical_line_alpha_draw */ |
65 |
|
|
/* _gx_display_driver_16bpp_vertical_line_alpha_draw */ |
66 |
|
|
/* _gx_display_driver_8bpp_vertical_line_alpha_draw */ |
67 |
|
|
/* */ |
68 |
|
|
/* RELEASE HISTORY */ |
69 |
|
|
/* */ |
70 |
|
|
/* DATE NAME DESCRIPTION */ |
71 |
|
|
/* */ |
72 |
|
|
/* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ |
73 |
|
|
/* 09-30-2020 Kenneth Maxwell Modified comment(s), */ |
74 |
|
|
/* resulting in version 6.1 */ |
75 |
|
|
/* */ |
76 |
|
|
/**************************************************************************/ |
77 |
|
144959 |
VOID _gx_display_driver_vertical_line_alpha_draw(GX_DRAW_CONTEXT *context, INT ystart, INT yend, INT xpos, INT width, GX_COLOR color, GX_UBYTE alpha) |
78 |
|
|
{ |
79 |
|
|
INT xval; |
80 |
|
|
INT yval; |
81 |
|
|
INT xend; |
82 |
|
|
VOID (*blend_func)(GX_DRAW_CONTEXT *context, INT x, INT y, GX_COLOR fcolor, GX_UBYTE alpha); |
83 |
|
|
|
84 |
|
144959 |
blend_func = context -> gx_draw_context_display -> gx_display_driver_pixel_blend; |
85 |
|
|
|
86 |
✓✓ |
144959 |
if (blend_func == GX_NULL) |
87 |
|
|
{ |
88 |
|
48 |
return; |
89 |
|
|
} |
90 |
|
|
|
91 |
|
144911 |
xend = xpos + width; |
92 |
|
|
/* draw line from top to bottom */ |
93 |
✓✓ |
6153355 |
for (yval = ystart; yval <= yend; yval++) |
94 |
|
|
{ |
95 |
|
|
/* draw line width from left to right */ |
96 |
✓✓ |
12255947 |
for (xval = xpos; xval < xend; xval++) |
97 |
|
|
{ |
98 |
|
6247503 |
blend_func(context, xval, yval, color, alpha); |
99 |
|
|
} |
100 |
|
|
} |
101 |
|
|
} |
102 |
|
|
|
103 |
|
|
#endif |