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 /**   Utility (Utility)                                                   */
18 /**                                                                       */
19 /**************************************************************************/
20 
21 #define GX_SOURCE_CODE
22 
23 
24 /* Include necessary system files.  */
25 
26 #include "gx_api.h"
27 #include "gx_utility.h"
28 
29 GX_CALLER_CHECKING_EXTERNS
30 
31 
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _gxe_utility_gradient_create                        PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Kenneth Maxwell, Microsoft Corporation                              */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This function checks for errors in the utility gradient create      */
45 /*    function call.                                                      */
46 /*                                                                        */
47 /*  INPUT                                                                 */
48 /*                                                                        */
49 /*    gradient                          Pointer to GX_GRADIENT            */
50 /*    width                             Width of gradient to create       */
51 /*    height                            Height of gradient to create      */
52 /*    type                              Gradient type to create           */
53 /*    alpha_start                       Gradient starting alpha value     */
54 /*    alpha_end                         Gradient ending alpha value       */
55 /*                                                                        */
56 /*  OUTPUT                                                                */
57 /*                                                                        */
58 /*    status                                Completion status             */
59 /*                                                                        */
60 /*  CALLS                                                                 */
61 /*                                                                        */
62 /*    _gx_utility_gradient_create           Actual utility gradient create*/
63 /*                                            call                        */
64 /*                                                                        */
65 /*  CALLED BY                                                             */
66 /*                                                                        */
67 /*    Application Code                                                    */
68 /*                                                                        */
69 /*  RELEASE HISTORY                                                       */
70 /*                                                                        */
71 /*    DATE              NAME                      DESCRIPTION             */
72 /*                                                                        */
73 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
74 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
75 /*                                            resulting in version 6.1    */
76 /*                                                                        */
77 /**************************************************************************/
_gxe_utility_gradient_create(GX_GRADIENT * gradient,GX_VALUE width,GX_VALUE height,UCHAR type,GX_UBYTE alpha_start,GX_UBYTE alpha_end)78 UINT _gxe_utility_gradient_create(GX_GRADIENT *gradient, GX_VALUE width, GX_VALUE height,
79                                   UCHAR type, GX_UBYTE alpha_start, GX_UBYTE alpha_end)
80 {
81 UINT status;
82 
83     /* Check for appropriate caller.  */
84     GX_INIT_AND_THREADS_CALLER_CHECKING
85 
86     if (gradient == GX_NULL)
87     {
88         return GX_PTR_ERROR;
89     }
90 
91     status = _gx_utility_gradient_create(gradient, width, height, type, alpha_start, alpha_end);
92 
93     return status;
94 }
95 
96