GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_image_reader_create.c Lines: 7 7 100.0 %
Date: 2026-03-06 19:21:09 Branches: 6 6 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
/**   Image Reader Management (Image Reader)                              */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_image_reader.h"
29
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gxe_image_reader_create                            PORTABLE C      */
35
/*                                                           6.1          */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION                                                           */
41
/*                                                                        */
42
/*    This function checks for errors in creating an image reader         */
43
/*    instance.                                                           */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    image_reader              Image reader control block.               */
48
/*    read_data                 pointer to raw input data.                */
49
/*    read_data_size            size of raw input data.                   */
50
/*    color_format              the requested output color format         */
51
/*    mode                      compress dither and alpha modes flags     */
52
/*                                                                        */
53
/*  OUTPUT                                                                */
54
/*                                                                        */
55
/*    status                    Completion status                         */
56
/*                                                                        */
57
/*  CALLS                                                                 */
58
/*   _gx_image_reader_create    Actual image reader create call.          */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    Application Code                                                    */
63
/*                                                                        */
64
/**************************************************************************/
65
#if defined(GX_SOFTWARE_DECODER_SUPPORT)
66
368
UINT  _gxe_image_reader_create(GX_IMAGE_READER *image_reader,
67
                               GX_CONST GX_UBYTE *read_data,
68
                               INT read_data_size,
69
                               GX_UBYTE color_format,
70
                               GX_UBYTE mode)
71
{
72
UINT status;
73
74
    /* Check for invalid input pointers.  */
75

368
    if ((image_reader == GX_NULL) || (read_data == GX_NULL))
76
    {
77
3
        return(GX_PTR_ERROR);
78
    }
79
80
365
    if (read_data_size <= 20)
81
    {
82
1
        return(GX_INVALID_VALUE);
83
    }
84
85
    /* Call the actual image reader info set function.  */
86
364
    status = _gx_image_reader_create(image_reader, read_data, read_data_size, color_format, mode);
87
88
    /* Return completion status.  */
89
364
    return status;
90
}
91
#endif
92