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 |
|
|
/** Text Input Management (Single Line Text Input) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
/* Include necessary system files. */ |
23 |
|
|
#define GX_SOURCE_CODE |
24 |
|
|
|
25 |
|
|
#include "gx_api.h" |
26 |
|
|
#include "gx_utility.h" |
27 |
|
|
|
28 |
|
|
/* Bring in externs for caller checking code. */ |
29 |
|
|
GX_CALLER_CHECKING_EXTERNS |
30 |
|
|
/**************************************************************************/ |
31 |
|
|
/* */ |
32 |
|
|
/* FUNCTION RELEASE */ |
33 |
|
|
/* */ |
34 |
|
|
/* _gx_utility_canvas_to_bmp PORTABLE C */ |
35 |
|
|
/* 6.1 */ |
36 |
|
|
/* AUTHOR */ |
37 |
|
|
/* */ |
38 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
39 |
|
|
/* */ |
40 |
|
|
/* DESCRIPTION */ |
41 |
|
|
/* */ |
42 |
|
|
/* Covert canvas memory data to bmp file. */ |
43 |
|
|
/* */ |
44 |
|
|
/* INPUT */ |
45 |
|
|
/* */ |
46 |
|
|
/* canvas Canvas control block */ |
47 |
|
|
/* rectangle Rectangle specification */ |
48 |
|
|
/* write_data Write data callback function */ |
49 |
|
|
/* */ |
50 |
|
|
/* OUTPUT */ |
51 |
|
|
/* */ |
52 |
|
|
/* status Completion status */ |
53 |
|
|
/* */ |
54 |
|
|
/* CALLS */ |
55 |
|
|
/* */ |
56 |
|
|
/* _gx_utility_canvas_to_bmp Actual function which do this */ |
57 |
|
|
/* convert. */ |
58 |
|
|
/* */ |
59 |
|
|
/* CALLED BY */ |
60 |
|
|
/* */ |
61 |
|
|
/* Application */ |
62 |
|
|
/* */ |
63 |
|
|
/**************************************************************************/ |
64 |
|
30 |
UINT _gxe_utility_canvas_to_bmp(GX_CANVAS *canvas, GX_RECTANGLE *rect, UINT (*write_data)(GX_UBYTE *byte_data, UINT data_count)) |
65 |
|
|
{ |
66 |
|
|
|
67 |
|
|
/* Check for appropriate caller. */ |
68 |
✓✓✓✓ ✓✓ |
30 |
GX_INIT_AND_THREADS_CALLER_CHECKING |
69 |
|
|
|
70 |
✓✓ |
28 |
if ((canvas == GX_NULL) || |
71 |
✓✓ |
26 |
(canvas -> gx_canvas_display == GX_NULL) || |
72 |
✓✓✓✓
|
25 |
(canvas -> gx_canvas_memory == NULL) || |
73 |
✓✓ |
23 |
(rect == GX_NULL) || |
74 |
|
|
(write_data == GX_NULL)) |
75 |
|
|
{ |
76 |
|
6 |
return GX_PTR_ERROR; |
77 |
|
|
} |
78 |
|
|
|
79 |
|
22 |
return _gx_utility_canvas_to_bmp(canvas, rect, write_data); |
80 |
|
|
} |