GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_24xrgb_rotated_png_draw.c Lines: 11 11 100.0 %
Date: 2026-03-06 19:21:09 Branches: 4 4 100.0 %

Line Branch Exec Source
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_context.h"
29
#include "gx_system.h"
30
#include "gx_display.h"
31
#include "gx_image_reader.h"
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _gx_display_driver_24xrgb_rotated_png_draw          PORTABLE C      */
38
/*                                                           6.1.4        */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    Kenneth Maxwell, Microsoft Corporation                              */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    Rotated 24xrgb format screen driver PNG drawing function.           */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    context                               Drawing context               */
50
/*    xpos                                  x-coord of top-left draw point*/
51
/*    ypos                                  y-coord of top-left draw point*/
52
/*    pixelmap                              Pointer to GX_PIXELMAP struct */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    None                                                                */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _gx_image_reader_create                                             */
61
/*    _gx_image_reader_start                                              */
62
/*    _gx_display_driver_24xrgb_rotated_pixelmap_draw                     */
63
/*    _gx_system_memory_free                                              */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    Application Code                                                    */
68
/*    GUIX Internal Code                                                  */
69
/*                                                                        */
70
/**************************************************************************/
71
#if defined(GX_SOFTWARE_DECODER_SUPPORT)
72
115
VOID _gx_display_driver_24xrgb_rotated_png_draw(GX_DRAW_CONTEXT *context, INT xpos, INT ypos, GX_PIXELMAP *pixelmap)
73
{
74
GX_IMAGE_READER image_reader;
75
GX_PIXELMAP     pic_outmap;
76
77
115
GX_UBYTE        mode = GX_IMAGE_READER_MODE_ALPHA;
78
79
115
    if (context -> gx_draw_context_display -> gx_display_rotation_angle == GX_SCREEN_ROTATION_CW)
80
    {
81
110
        mode |= GX_IMAGE_READER_MODE_ROTATE_CW;
82
    }
83
    else
84
    {
85
5
        mode |= GX_IMAGE_READER_MODE_ROTATE_CCW;
86
    }
87
88
115
    _gx_image_reader_create(&image_reader,
89
                            pixelmap -> gx_pixelmap_data,
90
115
                            (INT)pixelmap -> gx_pixelmap_data_size,
91
                            GX_COLOR_FORMAT_24XRGB, mode);
92
93
115
    if (_gx_image_reader_start(&image_reader, &pic_outmap) == GX_SUCCESS)
94
    {
95
110
        _gx_display_driver_32bpp_rotated_pixelmap_draw(context, xpos, ypos, &pic_outmap);
96
97
110
        _gx_system_memory_free((VOID *)pic_outmap.gx_pixelmap_data);
98
    }
99
115
}
100
#endif
101