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
118 uint16_t tValue;
119 struct {
120 uint16_t u5R : 5;
121 uint16_t u6G : 6;
122 uint16_t u5B : 5;
123 };
125
126/*! \brief In most cases four equal-sized pieces of adjacent memory are used,
127 *! one for each channel, and a 0 in a channel indicates black color or
128 *! transparent alpha, while all-1 bits indicates white or fully opaque
129 *! alpha. By far the most common format is to store 8 bits (one byte)
130 *! for each channel, which is 32 bits for each pixel.
131 *!
132 *! (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32)
133 */
135 uint32_t tValue;
136 struct {
137 uint32_t u8R : 8;
138 uint32_t u8G : 8;
139 uint32_t u8B : 8;
140 uint32_t u8A : 8;
141 };
143
144
146 uint32_t tValue;
147 struct {
148 uint32_t u8R : 8;
149 uint32_t u8G : 8;
150 uint32_t u8B : 8;
151 uint32_t : 8;
152 };
154
155
157 uint32_t tValue;
158 struct {
159 uint8_t u8C[3];
160 uint8_t u8A;
161 };
163
165 uint32_t tValue;
166 struct {
167 uint8_t u8A;
168 uint8_t u8C[3];
169 };
171
173 uint32_t tValue;
174 struct {
175 uint8_t u8C[3];
176 uint8_t : 8;
177 };
179
181 uint32_t tValue;
182 struct {
183 uint8_t : 8;
184 uint8_t u8C[3];
185 };
187
188//! \name colour size
189//! @{
190enum {
191 ARM_2D_COLOUR_SZ_1BIT = 0, //!< 1 bit:black and white
192 ARM_2D_COLOUR_SZ_2BIT = 1, //!< 4 colours or 4 gray-levels
193 ARM_2D_COLOUR_SZ_4BIT = 2, //!< 16 colours or 16 gray-levels
194 ARM_2D_COLOUR_SZ_8BIT = 3, //!< 256 colours
195 ARM_2D_COLOUR_SZ_16BIT = 4, //!< 16bits
196 ARM_2D_COLOUR_SZ_32BIT = 5, //!< true colour
197
198 ARM_2D_COLOUR_SZ_1BIT_msk = ARM_2D_COLOUR_SZ_1BIT << 1,
199 ARM_2D_COLOUR_SZ_2BIT_msk = ARM_2D_COLOUR_SZ_2BIT << 1,
200 ARM_2D_COLOUR_SZ_4BIT_msk = ARM_2D_COLOUR_SZ_4BIT << 1,
201 ARM_2D_COLOUR_SZ_8BIT_msk = ARM_2D_COLOUR_SZ_8BIT << 1,
202 ARM_2D_COLOUR_SZ_16BIT_msk = ARM_2D_COLOUR_SZ_16BIT<< 1,
203 ARM_2D_COLOUR_SZ_32BIT_msk = ARM_2D_COLOUR_SZ_32BIT<< 1,
204 ARM_2D_COLOUR_SZ_msk = (0x07 << 1),
205
206 ARM_2D_COLOUR_LITTLE_ENDIAN = 0,
207 ARM_2D_COLOUR_BIG_ENDIAN = 1,
208
209 ARM_2D_COLOUR_LITTLE_ENDIAN_msk = ARM_2D_COLOUR_LITTLE_ENDIAN << 4,
210 ARM_2D_COLOUR_BIG_ENDIAN_msk = ARM_2D_COLOUR_BIG_ENDIAN << 4,
211
212 ARM_2D_COLOUR_NO_ALPHA = 0,
213 ARM_2D_COLOUR_HAS_ALPHA = 1,
214
215 ARM_2D_COLOUR_NO_ALPHA_msk = ARM_2D_COLOUR_NO_ALPHA << 0,
216 ARM_2D_COLOUR_HAS_ALPHA_msk = ARM_2D_COLOUR_HAS_ALPHA << 0,
217
218 ARM_2D_COLOUR_VARIANT_pos = 5,
219 ARM_2D_COLOUR_VARIANT_msk = 0x07 << ARM_2D_COLOUR_VARIANT_pos,
220};
221//! @}
222
223//! \name macors for colour attributes
224//! @{
225#define ARM_2D_M_COLOUR_SZ_1BIT 0 //!< 1 bit:black and white
226#define ARM_2D_M_COLOUR_SZ_2BIT 1 //!< 4 colours or 4 gray-levels
227#define ARM_2D_M_COLOUR_SZ_4BIT 2 //!< 16 colours or 16 gray-levels
228#define ARM_2D_M_COLOUR_SZ_8BIT 3 //!< 256 colours
229#define ARM_2D_M_COLOUR_SZ_16BIT 4 //!< 16bits
230#define ARM_2D_M_COLOUR_SZ_32BIT 5 //!< true colour
231
232#define ARM_2D_M_COLOUR_SZ_1BIT_msk (ARM_2D_M_COLOUR_SZ_1BIT << 1)
233#define ARM_2D_M_COLOUR_SZ_2BIT_msk (ARM_2D_M_COLOUR_SZ_2BIT << 1)
234#define ARM_2D_M_COLOUR_SZ_4BIT_msk (ARM_2D_M_COLOUR_SZ_4BIT << 1)
235#define ARM_2D_M_COLOUR_SZ_8BIT_msk (ARM_2D_M_COLOUR_SZ_8BIT << 1)
236#define ARM_2D_M_COLOUR_SZ_16BIT_msk (ARM_2D_M_COLOUR_SZ_16BIT<< 1)
237#define ARM_2D_M_COLOUR_SZ_32BIT_msk (ARM_2D_M_COLOUR_SZ_32BIT<< 1)
238#define ARM_2D_M_COLOUR_SZ_msk (0x07 << 1),
239
240#define ARM_2D_M_COLOUR_LITTLE_ENDIAN 0
241#define ARM_2D_M_COLOUR_BIG_ENDIAN 1
242
243#define ARM_2D_M_COLOUR_LITTLE_ENDIAN_msk (ARM_2D_M_COLOUR_LITTLE_ENDIAN << 4)
244#define ARM_2D_M_COLOUR_BIG_ENDIAN_msk (ARM_2D_M_COLOUR_BIG_ENDIAN << 4)
245
246#define ARM_2D_M_COLOUR_NO_ALPHA 0
247#define ARM_2D_M_COLOUR_HAS_ALPHA 1
248
249#define ARM_2D_M_COLOUR_NO_ALPHA_msk (ARM_2D_M_COLOUR_NO_ALPHA << 0)
250#define ARM_2D_M_COLOUR_HAS_ALPHA_msk (ARM_2D_M_COLOUR_HAS_ALPHA << 0)
251
252#define ARM_2D_M_COLOUR_VARIANT_pos 5
253#define ARM_2D_M_COLOUR_VARIANT_msk (0x07 << ARM_2D_M_COLOUR_VARIANT_pos)
254//! @}
255
256//! \name colour scheme
257//! @{
258enum {
259 ARM_2D_COLOUR_BIN = ARM_2D_COLOUR_SZ_1BIT_msk,
260 ARM_2D_COLOUR_1BIT = ARM_2D_COLOUR_SZ_1BIT_msk,
261
262 ARM_2D_COLOUR_8BIT = ARM_2D_COLOUR_SZ_8BIT_msk,
263 ARM_2D_COLOUR_GRAY8 = ARM_2D_COLOUR_SZ_8BIT_msk,
264
265 ARM_2D_COLOUR_16BIT = ARM_2D_COLOUR_SZ_16BIT_msk,
266 ARM_2D_COLOUR_RGB16 = ARM_2D_COLOUR_SZ_16BIT_msk,
267 ARM_2D_COLOUR_RGB565 = ARM_2D_COLOUR_RGB16,
268
269/*! will not support
270 ARM_2D_COLOUR_RGB565_BE = ARM_2D_COLOUR_SZ_16BIT_msk |
271 ARM_2D_COLOUR_BIG_ENDIAN_msk ,
272 */
273
274 ARM_2D_COLOUR_32BIT = ARM_2D_COLOUR_SZ_32BIT_msk ,
275 ARM_2D_COLOUR_RGB32 = ARM_2D_COLOUR_SZ_32BIT_msk ,
276
277 ARM_2D_COLOUR_CCCN888 = ARM_2D_COLOUR_RGB32 ,
278 ARM_2D_COLOUR_CCCA8888 = ARM_2D_COLOUR_SZ_32BIT_msk |
279 ARM_2D_COLOUR_HAS_ALPHA_msk ,
280
281 ARM_2D_COLOUR_RGB888 = ARM_2D_COLOUR_CCCN888 ,
282 ARM_2D_COLOUR_RGBA8888 = ARM_2D_COLOUR_CCCA8888 ,
283
284/*! not supported yet
285 ARM_2D_COLOUR_NCCC888 = ARM_2D_COLOUR_RGB32 |
286 ARM_2D_COLOUR_BIG_ENDIAN_msk ,
287 ARM_2D_COLOUR_ACCC8888 = ARM_2D_COLOUR_SZ_32BIT_msk |
288 ARM_2D_COLOUR_HAS_ALPHA_msk |
289 ARM_2D_COLOUR_BIG_ENDIAN_msk ,
290*/
291 ARM_2D_CHANNEL_8in32 = ARM_2D_COLOUR_SZ_32BIT_msk |
292 ARM_2D_COLOUR_HAS_ALPHA_msk |
293 ARM_2D_COLOUR_VARIANT_msk ,
294};
295//! @}
296
297//! \name macros for colour formats used in code tempalte
298//! @{
299#define ARM_2D_M_COLOUR_BIN ARM_2D_M_COLOUR_SZ_1BIT_msk
300#define ARM_2D_M_COLOUR_1BIT ARM_2D_M_COLOUR_SZ_1BIT_msk
301
302#define ARM_2D_M_COLOUR_8BIT ARM_2D_M_COLOUR_SZ_8BIT_msk
303#define ARM_2D_M_COLOUR_GRAY8 ARM_2D_M_COLOUR_SZ_8BIT_msk
304
305#define ARM_2D_M_COLOUR_16BIT ARM_2D_M_COLOUR_SZ_16BIT_msk
306#define ARM_2D_M_COLOUR_RGB16 ARM_2D_M_COLOUR_SZ_16BIT_msk
307#define ARM_2D_M_COLOUR_RGB565 ARM_2D_M_COLOUR_RGB16
308
309/* will not support
310#define ARM_2D_M_COLOUR_RGB565_BE ( ARM_2D_M_COLOUR_SZ_16BIT_msk \
311 | ARM_2D_M_COLOUR_BIG_ENDIAN_msk )
312 */
313
314#define ARM_2D_M_COLOUR_32BIT ARM_2D_M_COLOUR_SZ_32BIT_msk
315#define ARM_2D_M_COLOUR_RGB32 ARM_2D_M_COLOUR_SZ_32BIT_msk
316
317#define ARM_2D_M_COLOUR_CCCN888 ARM_2D_M_COLOUR_RGB32
318#define ARM_2D_M_COLOUR_CCCA8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
319 | ARM_2D_M_COLOUR_HAS_ALPHA_msk)
320
321#define ARM_2D_M_COLOUR_RGB888 ARM_2D_M_COLOUR_CCCN888
322#define ARM_2D_M_COLOUR_RGBA8888 ARM_2D_M_COLOUR_CCCA8888
323
324/* not supported yet
325#define ARM_2D_M_COLOUR_NCCC888 ( ARM_2D_M_COLOUR_RGB32 \
326 | ARM_2D_M_COLOUR_BIG_ENDIAN_msk )
327#define ARM_2D_M_COLOUR_ACCC8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
328 | ARM_2D_M_COLOUR_HAS_ALPHA_msk \
329 | ARM_2D_M_COLOUR_BIG_ENDIAN_msk )
330*/
331#define ARM_2D_M_CHANNEL_8in32 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \
332 | ARM_2D_M_COLOUR_HAS_ALPHA_msk) \
333 | ARM_2D_M_COLOUR_VARIANT_msk )
334//! @}
335
336typedef union {
337 struct {
338 uint8_t bHasAlpha : 1; //!< whether the target colour has alpha channel
339 uint8_t u3ColourSZ : 3; //!< the size of the colour
340 uint8_t bBigEndian : 1; //!< whether the colour is stored in big endian
341 uint8_t u3Variant : 3;
342 };
343 uint8_t chScheme;
345
346
347
348/*----------------------------------------------------------------------------*
349 * Tile and Regions *
350 *----------------------------------------------------------------------------*/
351
352typedef struct arm_2d_location_t {
353 int16_t iX;
354 int16_t iY;
356
357typedef struct arm_2d_point_float_t {
358 float fX;
359 float fY;
361
362typedef struct arm_2d_point_fx_t {
363 int32_t X;
364 int32_t Y;
366
367typedef struct arm_2d_size_t {
368 int16_t iWidth;
369 int16_t iHeight;
371
372typedef struct arm_2d_region_t {
373 implement_ex(arm_2d_location_t, tLocation);
374 implement_ex(arm_2d_size_t, tSize);
376
377typedef struct arm_2d_tile_t arm_2d_tile_t;
379 implement_ex(struct {
380 uint8_t bIsRoot : 1; //!< is this tile a root tile
381 uint8_t bHasEnforcedColour : 1; //!< does this tile contains enforced colour info
382 uint8_t bDerivedResource : 1; //!< indicate whether this is a derived resources (when bIsRoot == 0)
383 uint8_t : 5;
384 uint8_t : 8;
385 uint8_t : 8;
386 arm_2d_color_info_t tColourInfo; //!< enforced colour
387 }, tInfo);
388
389 implement_ex(arm_2d_region_t, tRegion);
390
391 union {
392 /*! when bIsRoot is true, phwBuffer is available,
393 *! otherwise ptParent is available
394 */
395 arm_2d_tile_t *ptParent;
396 uint16_t *phwBuffer;
397 uint32_t *pwBuffer;
398 uint8_t *pchBuffer;
399 intptr_t nAddress;
400 };
401};
402
403/*----------------------------------------------------------------------------*
404 * Task *
405 *----------------------------------------------------------------------------*/
406typedef struct arm_2d_task_t {
407ARM_PRIVATE(
408 arm_fsm_rt_t tResult;
409 uint8_t chState;
410
411 void *ptTask;
414
415/*----------------------------------------------------------------------------*
416 * Operation and Events Handling *
417 *----------------------------------------------------------------------------*/
418
420
421typedef bool arm_2d_op_evt_handler_t( arm_2d_op_core_t *ptThisOP,
422 arm_fsm_rt_t tResult,
423 void *pTarget);
424
425typedef struct arm_2d_op_evt_t {
426 arm_2d_op_evt_handler_t *fnHandler; //!< event handler
427 void *pTarget; //!< user attached target
429
430typedef bool arm_2d_evt_handler_t(void *pTarget);
431
432typedef struct arm_2d_evt_t {
433 arm_2d_evt_handler_t *fnHandler; //!< event handler
434 void *pTarget; //!< user attached target
436
437
438#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE _BV(0)
439#define ARM_2D_OP_INFO_PARAM_HAS_TARGET _BV(1)
440#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK _BV(2)
441#define ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK _BV(3)
442#define ARM_2D_OP_INFO_PARAM_HAS_ORIGIN _BV(4)
443
444//! an imcomplete defintion which is only used for defining pointers
445typedef struct __arm_2d_low_level_io_t __arm_2d_low_level_io_t;
446
447typedef union __arm_2d_op_info_t {
448 struct {
449 arm_2d_color_info_t Colour; //!< the colour used in thie operation
450 union {
451 struct {
452 uint8_t bHasSource : 1; //!< whether this operation contains source tile
453 uint8_t bHasTarget : 1; //!< whether this operation contains target tile
454 uint8_t bHasSrcMask : 1; //!< whether this operation has Mask layer for source tile
455 uint8_t bHasDesMask : 1; //!< whether this operation has Mask layer for target tile
456 uint8_t bHasOrigin : 1; //!< whether the Source has an origin tile
457 uint8_t : 2;
458 uint8_t bAllowEnforcedColour : 1; //!< whether this operation allow enforced colours in tiles
459 };
460 uint8_t chValue;
461 }Param;
462
463 uint8_t chInClassOffset; //!< some operation uses this as the offset of the key member in the class
464 uint8_t chOpIndex; //!< __ARM_2D_OP_IDX_XXXXXX
465
466 union {
467 struct {
468 uint8_t CopyLike;
469 uint8_t FillLike;
470 };
471 struct {
472 uint8_t CopyOrigLike;
473 uint8_t FillOrigLike;
474 };
475 struct {
476 uint8_t TileProcessLike;
477 };
478 }LowLevelInterfaceIndex;
479
480 union {
481 const __arm_2d_low_level_io_t *IO[2];
482
483 struct {
484 const __arm_2d_low_level_io_t *ptCopyLike;
485 const __arm_2d_low_level_io_t *ptFillLike;
486 };
487 struct {
488 const __arm_2d_low_level_io_t *ptCopyOrigLike;
489 const __arm_2d_low_level_io_t *ptFillOrigLike;
490 };
491 struct {
492 const __arm_2d_low_level_io_t *ptTileProcessLike;
493 };
494 }LowLevelIO;
495
496 }Info;
497 uint32_t wID; //!< ID for a specific operation
499
500//! \name how would you want to accelerate the 2d-operation
501//! @{
502enum {
503 //! Use hardware acceleration if possible, even if there is a long queue to wait
504 ARM_2D_PREF_ACC_USE_HW_IF_POSSIBLE = 0,
505
506 //! Only use Hardware Acceleration, if it is not supported, IO error will be issued
507 ARM_2D_PREF_ACC_HW_ONLY = 1,
508
509 //! Only use software algorithm
510 ARM_2D_PREF_ACC_SW_ONLY = 2,
511
512 //!< don't care, let the arm-2d library decide
513 ARM_2D_PREF_ACC_DONT_CARE = 3,
514};
515//! @}
516
517
518#define __ARM_2D_OP_STATUS_BUSY_msk (1 << 4)
519#define __ARM_2D_OP_STATUS_IO_ERROR_msk (1 << 5)
520#define __ARM_2D_OP_STATUS_CPL_msk (1 << 6)
521
522
523typedef union arm_2d_op_status_t {
524 struct {
525 uint16_t u4SubTaskCount : 4; //!< sub task count
526 uint16_t bIsBusy : 1; //!< busy flag
527 uint16_t bIOError : 1; //!< HW IO Error
528 uint16_t bOpCpl : 1; //!< the whole operation complete
529 uint16_t : 9; //!< reserved
530 };
531 uint16_t tValue;
533
535ARM_PRIVATE(
536 arm_2d_op_core_t *ptNext; //!< pointer for a single list
537
538 const __arm_2d_op_info_t *ptOp;
539
540 struct {
541 uint8_t u2ACCMethods : 2; //!< acceleration Methods
542 uint8_t : 6; //!< reserved
543 }Preference;
544
545 int8_t tResult; //!< operation result
546 volatile arm_2d_op_status_t Status;
547
548 arm_2d_op_evt_t evt2DOpCpl; //!< operation complete event
549
551 uintptr_t pUserParam;
552};
553
554typedef struct arm_2d_op_t {
555 inherit(arm_2d_op_core_t);
556 struct {
557 const arm_2d_tile_t *ptTile; //!< target tile
558 const arm_2d_region_t *ptRegion; //!< target region
559 } Target;
561
562/*! \brief arm_2d_op_msk_t is inherit from arm_2d_op_t
563 */
564typedef struct arm_2d_op_msk_t {
565 inherit(arm_2d_op_core_t);
566 struct {
567 const arm_2d_tile_t *ptTile; //!< target tile
568 const arm_2d_region_t *ptRegion; //!< target region
569 } Target;
570
571
572 struct {
573 const arm_2d_tile_t *ptTile; //!< target tile
574 } Mask;
576
577/*! \brief arm_2d_op_src_t is inherit from arm_2d_op_t
578 */
579typedef struct arm_2d_op_src_t {
580 inherit(arm_2d_op_core_t);
581 struct {
582 const arm_2d_tile_t *ptTile; //!< target tile
583 const arm_2d_region_t *ptRegion; //!< target region
584 } Target;
585
586
587 struct {
588 const arm_2d_tile_t *ptTile; //!< source tile
589 }Source;
590 uint32_t wMode;
592
593/*! \brief arm_2d_op_src_msk_t is inherit from arm_2d_op_src_t
594 */
595typedef struct arm_2d_op_src_msk_t {
596 inherit(arm_2d_op_core_t);
597 struct {
598 const arm_2d_tile_t *ptTile; //!< target tile
599 const arm_2d_region_t *ptRegion; //!< target region
600 } Target;
601 struct {
602 const arm_2d_tile_t *ptTile; //!< source tile
603 }Source;
604 uint32_t wMode;
605
606
607 struct {
608 const arm_2d_tile_t *ptSourceSide; //!< source side mask
609 const arm_2d_tile_t *ptTargetSide; //!< target side mask
610 } Mask;
612
613
614/*! \brief arm_2d_op_src_orig_t is inherit from arm_2d_op_src_t
615 */
616typedef struct arm_2d_op_src_orig_t {
617 inherit(arm_2d_op_core_t);
618 struct {
619 const arm_2d_tile_t *ptTile; //!< target tile
620 const arm_2d_region_t *ptRegion; //!< target region
621 } Target;
622 struct {
623 const arm_2d_tile_t *ptTile; //!< source tile
624 }Source;
625 uint32_t wMode;
626
627 struct {
628 const arm_2d_tile_t *ptTile; //!< the origin tile
629 arm_2d_tile_t tDummySource; //!< the buffer for the source
630 }Origin;
631
633
634
635/*! \brief arm_2d_op_src_orig_msk_t is inherit from arm_2d_op_src_orig_t
636 */
638 inherit(arm_2d_op_core_t);
639 struct {
640 const arm_2d_tile_t *ptTile; //!< target tile
641 const arm_2d_region_t *ptRegion; //!< target region
642 } Target;
643 struct {
644 const arm_2d_tile_t *ptTile; //!< source tile
645 }Source;
646 uint32_t wMode;
647 struct {
648 const arm_2d_tile_t *ptTile; //!< the origin tile
649 arm_2d_tile_t tDummySource; //!< the buffer for the source
650 }Origin;
651
652 struct {
653 const arm_2d_tile_t *ptOriginSide; //!< origin side mask
654 const arm_2d_tile_t *ptTargetSide; //!< target side mask
655 } Mask;
657
658
659/*----------------------------------------------------------------------------*
660 * Fast Rotation linear regression structure
661 *----------------------------------------------------------------------------*/
662
663#if (__ARM_2D_HAS_HELIUM_FLOAT__ || __ARM_2D_HAS_FPU__) \
664 && !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__
665typedef struct arm_2d_rot_linear_regr_t {
666 float slopeY;
667 float interceptY;
668 float slopeX;
669 float interceptX;
671
672#else
673/* fixed point */
675 int32_t slopeY;
676 int32_t interceptY;
677 int32_t slopeX;
678 int32_t interceptX;
680
681#endif
682
683/*============================ GLOBAL VARIABLES ==============================*/
684/*============================ PROTOTYPES ====================================*/
685
686
687#if defined(__clang__)
688#pragma clang diagnostic pop
689#elif __IS_COMPILER_ARM_COMPILER_5__
690#pragma diag_warning 64
691#elif __IS_COMPILER_GCC__
692#pragma GCC diagnostic pop
693#endif
694
695#ifdef __cplusplus
696}
697#endif
698
699#endif // __ARM_2D_TYPES_H__
700
701