Arm-2D  
2D Image Processing Library for Cortex-M Processors
arm_2d_types.h
1/*
2 * Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19/* ----------------------------------------------------------------------
20 * Project: Arm-2D Library
21 * Title: cmsis_nn_typs.h
22 * Description: Public header file to contain the Arm-2D structs
23 *
24 * $Date: 01. December 2020
25 * $Revision: V.1.0.0
26 *
27 * Target Processor: Cortex-M cores
28 * -------------------------------------------------------------------- */
29
30
31#ifndef __ARM_2D_TYPES_H__
32#define __ARM_2D_TYPES_H__
33
34/*============================ INCLUDES ======================================*/
35#include <string.h>
36#include <stdint.h>
37#include <stdbool.h>
38#include <assert.h>
39
40#include "arm_2d_features.h"
41#include "arm_2d_utils.h"
42#include "__arm_2d_math.h"
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48#if defined(__clang__)
49# pragma clang diagnostic push
50# pragma clang diagnostic ignored "-Wunknown-warning-option"
51# pragma clang diagnostic ignored "-Wreserved-identifier"
52# pragma clang diagnostic ignored "-Wmissing-declarations"
53# pragma clang diagnostic ignored "-Wpadded"
54# pragma clang diagnostic ignored "-Wc11-extensions"
55#elif __IS_COMPILER_ARM_COMPILER_5__
56# pragma diag_suppress 64
57#elif __IS_COMPILER_GCC__
58# pragma GCC diagnostic push
59# pragma GCC diagnostic ignored "-Wmissing-declarations"
60# pragma GCC diagnostic ignored "-Wpadded"
61#endif
62
63
64/*============================ MACROS ========================================*/
65/*============================ MACROFIED FUNCTIONS ===========================*/
66/*============================ TYPES =========================================*/
67
68
69/*----------------------------------------------------------------------------*
70 * Infrastructure *
71 *----------------------------------------------------------------------------*/
72
73//! \name finite-state-machine status return (Compatible with arm_status), int8_t
74//! @{
75typedef enum {
76 arm_fsm_rt_err = -1, //!< fsm error
77 arm_fsm_rt_cpl = 0, //!< fsm complete
78 arm_fsm_rt_on_going = 1, //!< fsm on-going
79 arm_fsm_rt_wait_for_obj = 2, //!< fsm wait for IPC object
80 arm_fsm_rt_async = 3, //!< fsm work asynchronosely, please check it later.
81 arm_fsm_rt_wait_for_res = 4, //!< wait for resource
82} arm_fsm_rt_t;
83//! @}
84
85//! \name error code for arm-2d, int8_t
86//! \note arm_2d_err_t is compatible with arm_fsm_rt_t
87//! @{
88typedef enum {
89 ARM_2D_ERR_UNSUPPORTED_COLOUR = -11, //!< the specified colour is not supported
90 ARM_2D_ERR_BUSY = -10, //!< service is busy
91 ARM_2D_ERR_INSUFFICIENT_RESOURCE = -9, //!< insufficient resource
92 ARM_2D_ERR_IO_BUSY = -8, //!< HW accelerator is busy
93 ARM_2D_ERR_IO_ERROR = -7, //!< Generic HW error
94 ARM_2D_ERR_MISSING_PARAM = -6, //!< missing mandatory parameter
95 ARM_2D_ERR_INVALID_OP = -5, //!< unsupported / invalid operation
96 ARM_2D_ERR_NOT_SUPPORT = -4, //!< feature/service/operation is not supported
97 ARM_2D_ERR_OUT_OF_REGION = -3, //!< the operation is out of target area
98 ARM_2D_ERR_INVALID_PARAM = -2, //!< invalid parameter
99 ARM_2D_ERR_UNKNOWN = -1, //!< generic or unknown errors
100 ARM_2D_ERR_NONE = 0, //!< no error
101} arm_2d_err_t;
102//! @}
103
104//! \name compare result
105//! @{
106typedef enum {
107 ARM_2D_CMP_SMALLER = -1, //!< the target is smaller than the reference
108 ARM_2D_CMP_EQUALS = 0, //!< the target is equal to the reference
109 ARM_2D_CMP_LARGER = 1, //!< the target is larger than the reference
110} arm_2d_cmp_t;
111//! @}
112
113/*----------------------------------------------------------------------------*
114 * Colour definitions *
115 *----------------------------------------------------------------------------*/
116
117typedef union arm_2d_color_gray8_t {
118 uint8_t tValue;
120
122 uint16_t tValue;
123 struct {
124 uint16_t u5B : 5;
125 uint16_t u6G : 6;
126 uint16_t u5R : 5;
127 };
129
130/*! \brief In most cases four equal-sized pieces of adjacent memory are used,
131 *! one for each channel, and a 0 in a channel indicates black color or
132 *! transparent alpha, while all-1 bits indicates white or fully opaque
133 *! alpha. By far the most common format is to store 8 bits (one byte)
134 *! for each channel, which is 32 bits for each pixel.
135 *!
136 *! (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32)
137 */
139 uint32_t tValue;
140 struct {
141 uint32_t u8B : 8;
142 uint32_t u8G : 8;
143 uint32_t u8R : 8;
144 uint32_t u8A : 8;
145 };
147
148
150 uint32_t tValue;
151 struct {
152 uint32_t u8B : 8;
153 uint32_t u8G : 8;
154 uint32_t u8R : 8;
155 uint32_t : 8;
156 };
158
159
161 uint32_t tValue;
162 struct {
163 uint8_t u8C[3];
164 uint8_t u8A;
165 };
167
169 uint32_t tValue;
170 struct {
171 uint8_t u8A;
172 uint8_t u8C[3];
173 };
175
177 uint32_t tValue;
178 struct {
179 uint8_t u8C[3];
180 uint8_t : 8;
181 };
183
185 uint32_t tValue;
186 struct {
187 uint8_t : 8;
188 uint8_t u8C[3];
189 };
191
192//! \name colour size
193//! @{
194enum {
195 ARM_2D_COLOUR_SZ_1BIT = 0, //!< 1 bit:black and white
196 ARM_2D_COLOUR_SZ_2BIT = 1, //!< 4 colours or 4 gray-levels
197 ARM_2D_COLOUR_SZ_4BIT = 2, //!< 16 colours or 16 gray-levels
198 ARM_2D_COLOUR_SZ_8BIT = 3, //!< 256 colours
199 ARM_2D_COLOUR_SZ_16BIT = 4, //!< 16bits
200 ARM_2D_COLOUR_SZ_32BIT = 5, //!< true colour
201
202 ARM_2D_COLOUR_SZ_1BIT_msk = ARM_2D_COLOUR_SZ_1BIT << 1,
203 ARM_2D_COLOUR_SZ_2BIT_msk = ARM_2D_COLOUR_SZ_2BIT << 1,
204 ARM_2D_COLOUR_SZ_4BIT_msk = ARM_2D_COLOUR_SZ_4BIT << 1,
205 ARM_2D_COLOUR_SZ_8BIT_msk = ARM_2D_COLOUR_SZ_8BIT << 1,
206 ARM_2D_COLOUR_SZ_16BIT_msk = ARM_2D_COLOUR_SZ_16BIT<< 1,
207 ARM_2D_COLOUR_SZ_32BIT_msk = ARM_2D_COLOUR_SZ_32BIT<< 1,
208 ARM_2D_COLOUR_SZ_msk = (0x07 << 1),
209
210 ARM_2D_COLOUR_LITTLE_ENDIAN = 0,
211 ARM_2D_COLOUR_BIG_ENDIAN = 1,
212
213 ARM_2D_COLOUR_LITTLE_ENDIAN_msk = ARM_2D_COLOUR_LITTLE_ENDIAN << 4,
214 ARM_2D_COLOUR_BIG_ENDIAN_msk = ARM_2D_COLOUR_BIG_ENDIAN << 4,
215
216 ARM_2D_COLOUR_NO_ALPHA = 0,
217 ARM_2D_COLOUR_HAS_ALPHA = 1,
218
219 ARM_2D_COLOUR_NO_ALPHA_msk = ARM_2D_COLOUR_NO_ALPHA << 0,
220 ARM_2D_COLOUR_HAS_ALPHA_msk = ARM_2D_COLOUR_HAS_ALPHA << 0,
221
222 ARM_2D_COLOUR_VARIANT_pos = 5,
223 ARM_2D_COLOUR_VARIANT_msk = 0x07 << ARM_2D_COLOUR_VARIANT_pos,
224};
225//! @}
226
227//! \name macors for colour attributes
228//! @{
229#define ARM_2D_M_COLOUR_SZ_1BIT 0 //!< 1 bit:black and white
230#define ARM_2D_M_COLOUR_SZ_2BIT 1 //!< 4 colours or 4 gray-levels
231#define ARM_2D_M_COLOUR_SZ_4BIT 2 //!< 16 colours or 16 gray-levels
232#define ARM_2D_M_COLOUR_SZ_8BIT 3 //!< 256 colours
233#define ARM_2D_M_COLOUR_SZ_16BIT 4 //!< 16bits
234#define ARM_2D_M_COLOUR_SZ_32BIT 5 //!< true colour
235
236#define ARM_2D_M_COLOUR_SZ_1BIT_msk (ARM_2D_M_COLOUR_SZ_1BIT << 1)
237#define ARM_2D_M_COLOUR_SZ_2BIT_msk (ARM_2D_M_COLOUR_SZ_2BIT << 1)
238#define ARM_2D_M_COLOUR_SZ_4BIT_msk (ARM_2D_M_COLOUR_SZ_4BIT << 1)
239#define ARM_2D_M_COLOUR_SZ_8BIT_msk (ARM_2D_M_COLOUR_SZ_8BIT << 1)
240#define ARM_2D_M_COLOUR_SZ_16BIT_msk (ARM_2D_M_COLOUR_SZ_16BIT<< 1)
241#define ARM_2D_M_COLOUR_SZ_32BIT_msk (ARM_2D_M_COLOUR_SZ_32BIT<< 1)
242#define ARM_2D_M_COLOUR_SZ_msk (0x07 << 1),
243
244#define ARM_2D_M_COLOUR_LITTLE_ENDIAN 0
245#define ARM_2D_M_COLOUR_BIG_ENDIAN 1
246
247#define ARM_2D_M_COLOUR_LITTLE_ENDIAN_msk (ARM_2D_M_COLOUR_LITTLE_ENDIAN << 4)
248#define ARM_2D_M_COLOUR_BIG_ENDIAN_msk (ARM_2D_M_COLOUR_BIG_ENDIAN << 4)
249
250#define ARM_2D_M_COLOUR_NO_ALPHA 0
251#define ARM_2D_M_COLOUR_HAS_ALPHA 1
252
253#define ARM_2D_M_COLOUR_NO_ALPHA_msk (ARM_2D_M_COLOUR_NO_ALPHA << 0)
254#define ARM_2D_M_COLOUR_HAS_ALPHA_msk (ARM_2D_M_COLOUR_HAS_ALPHA << 0)
255
256#define ARM_2D_M_COLOUR_VARIANT_pos 5
257#define ARM_2D_M_COLOUR_VARIANT_msk (0x07 << ARM_2D_M_COLOUR_VARIANT_pos)
258//! @}
259
260//! \name colour scheme
261//! @{
262enum {
263 ARM_2D_COLOUR_BIN = ARM_2D_COLOUR_SZ_1BIT_msk,
264 ARM_2D_COLOUR_1BIT = ARM_2D_COLOUR_SZ_1BIT_msk,
265
266 ARM_2D_COLOUR_8BIT = ARM_2D_COLOUR_SZ_8BIT_msk,
267 ARM_2D_COLOUR_GRAY8 = ARM_2D_COLOUR_SZ_8BIT_msk,
268
269 ARM_2D_COLOUR_16BIT = ARM_2D_COLOUR_SZ_16BIT_msk,
270 ARM_2D_COLOUR_RGB16 = ARM_2D_COLOUR_SZ_16BIT_msk,
271 ARM_2D_COLOUR_RGB565 = ARM_2D_COLOUR_RGB16,
272
273/*! will not support
274 ARM_2D_COLOUR_RGB565_BE = ARM_2D_COLOUR_SZ_16BIT_msk |
275 ARM_2D_COLOUR_BIG_ENDIAN_msk ,
276 */
277
278 ARM_2D_COLOUR_32BIT = ARM_2D_COLOUR_SZ_32BIT_msk ,
279 ARM_2D_COLOUR_RGB32 = ARM_2D_COLOUR_SZ_32BIT_msk ,
280
281 ARM_2D_COLOUR_CCCN888 = ARM_2D_COLOUR_RGB32 ,
282 ARM_2D_COLOUR_CCCA8888 = ARM_2D_COLOUR_SZ_32BIT_msk |
283 ARM_2D_COLOUR_HAS_ALPHA_msk ,
284
285 ARM_2D_COLOUR_RGB888 = ARM_2D_COLOUR_CCCN888 ,
286 ARM_2D_COLOUR_BGRA8888 = ARM_2D_COLOUR_CCCA8888 ,
287
288/*! not supported yet
289 ARM_2D_COLOUR_NCCC888 = ARM_2D_COLOUR_RGB32 |
290 ARM_2D_COLOUR_BIG_ENDIAN_msk ,
291 ARM_2D_COLOUR_ACCC8888 = ARM_2D_COLOUR_SZ_32BIT_msk |
292 ARM_2D_COLOUR_HAS_ALPHA_msk |
293 ARM_2D_COLOUR_BIG_ENDIAN_msk ,
294*/
295 ARM_2D_CHANNEL_8in32 = ARM_2D_COLOUR_SZ_32BIT_msk |
296 ARM_2D_COLOUR_HAS_ALPHA_msk |
297 ARM_2D_COLOUR_VARIANT_msk ,
298};
299//! @}
300
301//! \name macros for colour formats used in code tempalte
302//! @{
303#define ARM_2D_M_COLOUR_BIN ARM_2D_M_COLOUR_SZ_1BIT_msk
304#define ARM_2D_M_COLOUR_1BIT ARM_2D_M_COLOUR_SZ_1BIT_msk
305
306#define ARM_2D_M_COLOUR_8BIT ARM_2D_M_COLOUR_SZ_8BIT_msk
307#define ARM_2D_M_COLOUR_GRAY8 ARM_2D_M_COLOUR_SZ_8BIT_msk
308
309#define ARM_2D_M_COLOUR_16BIT ARM_2D_M_COLOUR_SZ_16BIT_msk
310#define ARM_2D_M_COLOUR_RGB16 ARM_2D_M_COLOUR_SZ_16BIT_msk
311#define ARM_2D_M_COLOUR_RGB565 ARM_2D_M_COLOUR_RGB16
312
313/* will not support
314#define ARM_2D_M_COLOUR_RGB565_BE ( ARM_2D_M_COLOUR_SZ_16BIT_msk \
315 | ARM_2D_M_COLOUR_BIG_ENDIAN_msk )
316 */
317
318#define ARM_2D_M_COLOUR_32BIT ARM_2D_M_COLOUR_SZ_32BIT_msk
319#define ARM_2D_M_COLOUR_RGB32 ARM_2D_M_COLOUR_SZ_32BIT_msk
320
321#define ARM_2D_M_COLOUR_CCCN888 ARM_2D_M_COLOUR_RGB32
322#define ARM_2D_M_COLOUR_CCCA8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
323 | ARM_2D_M_COLOUR_HAS_ALPHA_msk)
324
325#define ARM_2D_M_COLOUR_RGB888 ARM_2D_M_COLOUR_CCCN888
326#define ARM_2D_M_COLOUR_RGBA8888 ARM_2D_M_COLOUR_CCCA8888
327
328/* not supported yet
329#define ARM_2D_M_COLOUR_NCCC888 ( ARM_2D_M_COLOUR_RGB32 \
330 | ARM_2D_M_COLOUR_BIG_ENDIAN_msk )
331#define ARM_2D_M_COLOUR_ACCC8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
332 | ARM_2D_M_COLOUR_HAS_ALPHA_msk \
333 | ARM_2D_M_COLOUR_BIG_ENDIAN_msk )
334*/
335#define ARM_2D_M_CHANNEL_8in32 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
336 | ARM_2D_M_COLOUR_HAS_ALPHA_msk) \
337 | ARM_2D_M_COLOUR_VARIANT_msk )
338//! @}
339
340typedef union {
341 struct {
342 uint8_t bHasAlpha : 1; //!< whether the target colour has alpha channel
343 uint8_t u3ColourSZ : 3; //!< the size of the colour
344 uint8_t bBigEndian : 1; //!< whether the colour is stored in big endian
345 uint8_t u3Variant : 3;
346 };
347 uint8_t chScheme;
349
350
351
352/*----------------------------------------------------------------------------*
353 * Tile and Regions *
354 *----------------------------------------------------------------------------*/
355
356typedef struct arm_2d_location_t {
357 int16_t iX;
358 int16_t iY;
360
361typedef struct arm_2d_point_float_t {
362 float fX;
363 float fY;
365
366typedef struct arm_2d_point_fx_t {
367 int32_t X;
368 int32_t Y;
370
371typedef struct arm_2d_size_t {
372 int16_t iWidth;
373 int16_t iHeight;
375
376typedef struct arm_2d_region_t {
377 implement_ex(arm_2d_location_t, tLocation);
378 implement_ex(arm_2d_size_t, tSize);
380
381typedef struct arm_2d_tile_t arm_2d_tile_t;
383 implement_ex(struct {
384 uint8_t bIsRoot : 1; //!< is this tile a root tile
385 uint8_t bHasEnforcedColour : 1; //!< does this tile contains enforced colour info
386 uint8_t bDerivedResource : 1; //!< indicate whether this is a derived resources (when bIsRoot == 0)
387 uint8_t : 5;
388 uint8_t : 8;
389 uint8_t : 8;
390 arm_2d_color_info_t tColourInfo; //!< enforced colour
391 }, tInfo);
392
393 implement_ex(arm_2d_region_t, tRegion);
394
395 union {
396 /*! when bIsRoot is true, phwBuffer is available,
397 *! otherwise ptParent is available
398 */
399 arm_2d_tile_t *ptParent;
400 uint16_t *phwBuffer;
401 uint32_t *pwBuffer;
402 uint8_t *pchBuffer;
403 intptr_t nAddress;
404 };
405};
406
407/*----------------------------------------------------------------------------*
408 * Task *
409 *----------------------------------------------------------------------------*/
410typedef struct arm_2d_task_t {
411ARM_PRIVATE(
412 arm_fsm_rt_t tResult;
413 uint8_t chState;
414
415 void *ptTask;
418
419/*----------------------------------------------------------------------------*
420 * Operation and Events Handling *
421 *----------------------------------------------------------------------------*/
422
424
425typedef bool arm_2d_op_evt_handler_t( arm_2d_op_core_t *ptThisOP,
426 arm_fsm_rt_t tResult,
427 void *pTarget);
428
429typedef struct arm_2d_op_evt_t {
430 arm_2d_op_evt_handler_t *fnHandler; //!< event handler
431 void *pTarget; //!< user attached target
433
434typedef bool arm_2d_evt_handler_t(void *pTarget);
435
436typedef struct arm_2d_evt_t {
437 arm_2d_evt_handler_t *fnHandler; //!< event handler
438 void *pTarget; //!< user attached target
440
441
442#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE _BV(0)
443#define ARM_2D_OP_INFO_PARAM_HAS_TARGET _BV(1)
444#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK _BV(2)
445#define ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK _BV(3)
446#define ARM_2D_OP_INFO_PARAM_HAS_ORIGIN _BV(4)
447
448//! an imcomplete defintion which is only used for defining pointers
449typedef struct __arm_2d_low_level_io_t __arm_2d_low_level_io_t;
450
451typedef union __arm_2d_op_info_t {
452 struct {
453 arm_2d_color_info_t Colour; //!< the colour used in thie operation
454 union {
455 struct {
456 uint8_t bHasSource : 1; //!< whether this operation contains source tile
457 uint8_t bHasTarget : 1; //!< whether this operation contains target tile
458 uint8_t bHasSrcMask : 1; //!< whether this operation has Mask layer for source tile
459 uint8_t bHasDesMask : 1; //!< whether this operation has Mask layer for target tile
460 uint8_t bHasOrigin : 1; //!< whether the Source has an origin tile
461 uint8_t : 2;
462 uint8_t bAllowEnforcedColour : 1; //!< whether this operation allow enforced colours in tiles
463 };
464 uint8_t chValue;
465 }Param;
466
467 uint8_t chInClassOffset; //!< some operation uses this as the offset of the key member in the class
468 uint8_t chOpIndex; //!< __ARM_2D_OP_IDX_XXXXXX
469
470 union {
471 struct {
472 uint8_t CopyLike;
473 uint8_t FillLike;
474 };
475 struct {
476 uint8_t CopyOrigLike;
477 uint8_t FillOrigLike;
478 };
479 struct {
480 uint8_t TileProcessLike;
481 };
482 }LowLevelInterfaceIndex;
483
484 union {
485 const __arm_2d_low_level_io_t *IO[2];
486
487 struct {
488 const __arm_2d_low_level_io_t *ptCopyLike;
489 const __arm_2d_low_level_io_t *ptFillLike;
490 };
491 struct {
492 const __arm_2d_low_level_io_t *ptCopyOrigLike;
493 const __arm_2d_low_level_io_t *ptFillOrigLike;
494 };
495 struct {
496 const __arm_2d_low_level_io_t *ptTileProcessLike;
497 };
498 }LowLevelIO;
499
500 }Info;
501 uint32_t wID; //!< ID for a specific operation
503
504//! \name how would you want to accelerate the 2d-operation
505//! @{
506enum {
507 //! Use hardware acceleration if possible, even if there is a long queue to wait
508 ARM_2D_PREF_ACC_USE_HW_IF_POSSIBLE = 0,
509
510 //! Only use Hardware Acceleration, if it is not supported, IO error will be issued
511 ARM_2D_PREF_ACC_HW_ONLY = 1,
512
513 //! Only use software algorithm
514 ARM_2D_PREF_ACC_SW_ONLY = 2,
515
516 //!< don't care, let the arm-2d library decide
517 ARM_2D_PREF_ACC_DONT_CARE = 3,
518};
519//! @}
520
521
522#define __ARM_2D_OP_STATUS_BUSY_msk (1 << 4)
523#define __ARM_2D_OP_STATUS_IO_ERROR_msk (1 << 5)
524#define __ARM_2D_OP_STATUS_CPL_msk (1 << 6)
525
526
527typedef union arm_2d_op_status_t {
528 struct {
529 uint16_t u4SubTaskCount : 4; //!< sub task count
530 uint16_t bIsBusy : 1; //!< busy flag
531 uint16_t bIOError : 1; //!< HW IO Error
532 uint16_t bOpCpl : 1; //!< the whole operation complete
533 uint16_t : 9; //!< reserved
534 };
535 uint16_t tValue;
537
539ARM_PRIVATE(
540 arm_2d_op_core_t *ptNext; //!< pointer for a single list
541
542 const __arm_2d_op_info_t *ptOp;
543
544 struct {
545 uint8_t u2ACCMethods : 2; //!< acceleration Methods
546 uint8_t : 6; //!< reserved
547 }Preference;
548
549 int8_t tResult; //!< operation result
550 volatile arm_2d_op_status_t Status;
551
552 arm_2d_op_evt_t evt2DOpCpl; //!< operation complete event
553
555 uintptr_t pUserParam;
556};
557
558typedef struct arm_2d_op_t {
559 inherit(arm_2d_op_core_t);
560 struct {
561 const arm_2d_tile_t *ptTile; //!< target tile
562 const arm_2d_region_t *ptRegion; //!< target region
563 } Target;
565
566/*! \brief arm_2d_op_msk_t is inherit from arm_2d_op_t
567 */
568typedef struct arm_2d_op_msk_t {
569 inherit(arm_2d_op_core_t);
570 struct {
571 const arm_2d_tile_t *ptTile; //!< target tile
572 const arm_2d_region_t *ptRegion; //!< target region
573 } Target;
574
575
576 struct {
577 const arm_2d_tile_t *ptTile; //!< target tile
578 } Mask;
580
581/*! \brief arm_2d_op_src_t is inherit from arm_2d_op_t
582 */
583typedef struct arm_2d_op_src_t {
584 inherit(arm_2d_op_core_t);
585 struct {
586 const arm_2d_tile_t *ptTile; //!< target tile
587 const arm_2d_region_t *ptRegion; //!< target region
588 } Target;
589
590
591 struct {
592 const arm_2d_tile_t *ptTile; //!< source tile
593 }Source;
594 uint32_t wMode;
596
597/*! \brief arm_2d_op_src_msk_t is inherit from arm_2d_op_src_t
598 */
599typedef struct arm_2d_op_src_msk_t {
600 inherit(arm_2d_op_core_t);
601 struct {
602 const arm_2d_tile_t *ptTile; //!< target tile
603 const arm_2d_region_t *ptRegion; //!< target region
604 } Target;
605 struct {
606 const arm_2d_tile_t *ptTile; //!< source tile
607 }Source;
608 uint32_t wMode;
609
610
611 struct {
612 const arm_2d_tile_t *ptSourceSide; //!< source side mask
613 const arm_2d_tile_t *ptTargetSide; //!< target side mask
614 } Mask;
616
617
618/*! \brief arm_2d_op_src_orig_t is inherit from arm_2d_op_src_t
619 */
620typedef struct arm_2d_op_src_orig_t {
621 inherit(arm_2d_op_core_t);
622 struct {
623 const arm_2d_tile_t *ptTile; //!< target tile
624 const arm_2d_region_t *ptRegion; //!< target region
625 } Target;
626 struct {
627 const arm_2d_tile_t *ptTile; //!< source tile
628 }Source;
629 uint32_t wMode;
630
631 struct {
632 const arm_2d_tile_t *ptTile; //!< the origin tile
633 arm_2d_tile_t tDummySource; //!< the buffer for the source
634 }Origin;
635
637
638
639/*! \brief arm_2d_op_src_orig_msk_t is inherit from arm_2d_op_src_orig_t
640 */
642 inherit(arm_2d_op_core_t);
643 struct {
644 const arm_2d_tile_t *ptTile; //!< target tile
645 const arm_2d_region_t *ptRegion; //!< target region
646 } Target;
647 struct {
648 const arm_2d_tile_t *ptTile; //!< source tile
649 }Source;
650 uint32_t wMode;
651 struct {
652 const arm_2d_tile_t *ptTile; //!< the origin tile
653 arm_2d_tile_t tDummySource; //!< the buffer for the source
654 }Origin;
655
656 struct {
657 const arm_2d_tile_t *ptOriginSide; //!< origin side mask
658 const arm_2d_tile_t *ptTargetSide; //!< target side mask
659 } Mask;
661
662
663/*----------------------------------------------------------------------------*
664 * Fast Rotation linear regression structure
665 *----------------------------------------------------------------------------*/
666
667#if (__ARM_2D_HAS_HELIUM_FLOAT__ || __ARM_2D_HAS_FPU__) \
668 && !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__
669typedef struct arm_2d_rot_linear_regr_t {
670 float slopeY;
671 float interceptY;
672 float slopeX;
673 float interceptX;
675
676#else
677/* fixed point */
679 int32_t slopeY;
680 int32_t interceptY;
681 int32_t slopeX;
682 int32_t interceptX;
684
685#endif
686
687/*============================ GLOBAL VARIABLES ==============================*/
688/*============================ PROTOTYPES ====================================*/
689
690
691#if defined(__clang__)
692#pragma clang diagnostic pop
693#elif __IS_COMPILER_ARM_COMPILER_5__
694#pragma diag_warning 64
695#elif __IS_COMPILER_GCC__
696#pragma GCC diagnostic pop
697#endif
698
699#ifdef __cplusplus
700}
701#endif
702
703#endif // __ARM_2D_TYPES_H__
704
705