1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
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 /**************************************************************************/
31 /* */
32 /* FUNCTION RELEASE */
33 /* */
34 /* _gx_display_driver_16bpp_pixel_write PORTABLE C */
35 /* 6.1 */
36 /* AUTHOR */
37 /* */
38 /* Kenneth Maxwell, Microsoft Corporation */
39 /* */
40 /* DESCRIPTION */
41 /* */
42 /* Generic 16bpp color format pixel write function. */
43 /* */
44 /* INPUT */
45 /* */
46 /* context Drawing context */
47 /* x X coordinate */
48 /* y Y coordinate */
49 /* color Color of pixel to write */
50 /* */
51 /* OUTPUT */
52 /* */
53 /* None */
54 /* */
55 /* CALLS */
56 /* */
57 /* None */
58 /* */
59 /* CALLED BY */
60 /* */
61 /* GUIX Internal Code */
62 /* */
63 /* RELEASE HISTORY */
64 /* */
65 /* DATE NAME DESCRIPTION */
66 /* */
67 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */
68 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */
69 /* resulting in version 6.1 */
70 /* */
71 /**************************************************************************/
_gx_display_driver_16bpp_pixel_write(GX_DRAW_CONTEXT * context,INT x,INT y,GX_COLOR color)72 VOID _gx_display_driver_16bpp_pixel_write(GX_DRAW_CONTEXT *context, INT x, INT y, GX_COLOR color)
73 {
74 USHORT *put = (USHORT *)context -> gx_draw_context_memory;
75
76 /* calculate address of scan line */
77 put += context -> gx_draw_context_pitch * y;
78
79 /* step in by x coordinate */
80 put += x;
81
82 /* write the pixel value */
83 *put = (USHORT)color;
84 }
85
86