MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_widget_imagerotate.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
23 
24 /*******************************************************************************
25  Module for Microchip Graphics Library - Legato User Interface Library
26 
27  Company:
28  Microchip Technology Inc.
29 
30  File Name:
31  legato_widget_imagerotate.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements a rotatable image widget.
38 *******************************************************************************/
39 
46 #ifndef LEGATO_IMAGEROTATE_H
47 #define LEGATO_IMAGEROTATE_H
48 
50 
51 #if LE_IMAGEROTATE_WIDGET_ENABLED == 1
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
59 
60 typedef struct leImageRotateWidget leImageRotateWidget;
61 
62 // *****************************************************************************
63 // *****************************************************************************
64 // Section: Data Types and Constants
65 // *****************************************************************************
66 // *****************************************************************************
67 
68 /* internal use only */typedef struct leImageRotateWidget leImageRotateWidget;
73 
74 #define LE_IMAGEROTATEWIDGET_VTABLE(THIS_TYPE) \
75  LE_WIDGET_VTABLE(THIS_TYPE) \
76  \
77  leImage* (*getImage)(const THIS_TYPE* _this); \
78  leResult (*setImage)(THIS_TYPE* _this, const leImage* img); \
79  int32_t (*getAngle)(const THIS_TYPE* _this); \
80  leResult (*setAngle)(THIS_TYPE* _this, int32_t a); \
81  leImageFilterMode (*getFilter)(const THIS_TYPE* _this); \
82  leResult (*setFilter)(THIS_TYPE* _this, leImageFilterMode filter); \
83 
84 typedef struct leImageRotateWidgetVTable
85 {
86  LE_IMAGEROTATEWIDGET_VTABLE(leImageRotateWidget)
87 } leImageRotateWidgetVTable;
88 
89 // DOM-IGNORE-END
90 
91 // *****************************************************************************
92 /* Enumeration:
93  leImageRotateWidget
94 
95  Summary:
96  Image rotate widget struct definition
97 
98  Description:
99  An image rotate widget displays an image asset and can translate and resize that image.
100 
101  Remarks:
102  None.
103 */
104 
110 typedef struct leImageRotateWidget
111 {
112  leWidget widget; // widget base class
113 
114  const leImageRotateWidgetVTable* fn;
115 
116  const leImage* image; // pointer to image asset
117 
118  int32_t angle;
119 
120  leImageFilterMode filter;
121 } leImageRotateWidget;
122 
123 /* internal use only */
129 void _leImageRotateWidget_Destructor(leImageRotateWidget* img);
130 
131 void _leImageRotateWidget_Paint(leImageRotateWidget* img);
137 // *****************************************************************************
138 // *****************************************************************************
139 // Section: Routines
140 // *****************************************************************************
141 // *****************************************************************************
142 
154 leImageRotateWidget* leImageRotateWidget_New(void);
155 
166 void leImageRotateWidget_Constructor(leImageRotateWidget* wgt);
167 
168 #ifdef _DOXYGEN_
169 #define THIS_TYPE struct leWidget
170 
181 virtual leImage* getImage(const leImageRotateWidget* _this);
182 
183 
197 virtual leResult setImage(leImageRotateWidget* _this,
198  leImage* img);
199 
200 
211 virtual lePoint getOrigin(const leImageRotateWidget* _this);
212 
213 
227 virtual leResult setOrigin(leImageRotateWidget* _this,
228  lePoint origin);
229 
230 // *****************************************************************************
241 virtual int32_t getAngle(const leImageRotateWidget* _this);
242 
243 
244 // *****************************************************************************
258 virtual leResult setAngle(leImageRotateWidget* _this,
259  int32_t angle);
260 
261 
262 // *****************************************************************************
273 virtual leImageFilter getFilter(const leImageRotateWidget* _this);
274 
275 
276 // *****************************************************************************
290 virtual leResult setFilter(leImageRotateWidget* _this,
291  leImageFilter filter);
292 
293 #undef THIS_TYPE
294 #endif
295 
296 #ifdef __cplusplus
297 }
298 #endif
299 
300 #endif // LE_IMAGEROTATE_WIDGET_ENABLED
301 #endif /* LEGATO_IMAGEROTATE_H */
Common macros and definitions used by Legato.
Image functions and defintions.
Definition: legato_image.h:181
leResult
This enum represents function call results.
Definition: legato_common.h:123
Used to define a widget.
Definition: legato_widget.h:624
leImageFilterMode
This enum represents image filter modes.
Definition: legato_image.h:110
This structure represents a integer Cartesian point.
Definition: legato_common.h:346
Legato widget definitions.
Definition: widget.py:1