Arm-2D  
2D Image Processing Library for Cortex-M Processors
 
Loading...
Searching...
No Matches
__arm_2d_filter_iir_blur.h
1/*
2 * Copyright (C) 2024 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: __arm_2d_filter_iir_blur.h
22 * Description: APIs for IIR Blur
23 *
24 * $Date: 25. April 2025
25 * $Revision: V.2.0.0
26 *
27 * Target Processor: Cortex-M cores
28 *
29 * -------------------------------------------------------------------- */
30
31#ifndef __ARM_2D_FILTER_IIR_BLUR_H__
32#define __ARM_2D_FILTER_IIR_BLUR_H__
33
34/*============================ INCLUDES ======================================*/
35#include "arm_2d_types.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#if defined(__clang__)
42# pragma clang diagnostic push
43# pragma clang diagnostic ignored "-Wunknown-warning-option"
44# pragma clang diagnostic ignored "-Wreserved-identifier"
45# pragma clang diagnostic ignored "-Wdeclaration-after-statement"
46# pragma clang diagnostic ignored "-Wsign-conversion"
47# pragma clang diagnostic ignored "-Wpadded"
48# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
49# pragma clang diagnostic ignored "-Wmissing-declarations"
50#elif defined(__IS_COMPILER_ARM_COMPILER_5__)
51# pragma diag_suppress 174,177,188,68,513,144,64
52#endif
53
54/*!
55 * \addtogroup gFilter 7 Filter Operations
56 * @{
57 */
58
59/*============================ MACROS ========================================*/
60/*============================ MACROFIED FUNCTIONS ===========================*/
61/*============================ TYPES =========================================*/
62
63typedef enum {
64 ARM_IIR_BLUR_MODE_HORIZONTAL = (1 << 0),
65 ARM_IIR_BLUR_MODE_VERTICAL = (1 << 1),
66
67 ARM_IIR_BLUR_MODE_REVERSE_HORIZONTAL = (1 << 2),
68 ARM_IIR_BLUR_MODE_REVERSE_VERTICAL = (1 << 3),
69
70 ARM_IIR_BLUR_MODE_FORWARD = ARM_IIR_BLUR_MODE_HORIZONTAL
71 | ARM_IIR_BLUR_MODE_VERTICAL,
72
73 ARM_IIR_BLUR_MODE_REVERSE = ARM_IIR_BLUR_MODE_REVERSE_HORIZONTAL
74 | ARM_IIR_BLUR_MODE_REVERSE_VERTICAL,
75
76 ARM_IIR_BLUR_MODE_DEFAULT = 0,
77 ARM_IIR_BLUR_MODE_BEST = ARM_IIR_BLUR_MODE_FORWARD
78 | ARM_IIR_BLUR_MODE_REVERSE,
79
80 ARM_IIR_BLUR_MODE_BEST_HORIZONTAL = ARM_IIR_BLUR_MODE_HORIZONTAL
81 | ARM_IIR_BLUR_MODE_REVERSE_HORIZONTAL,
82
83 ARM_IIR_BLUR_MODE_BEST_VERTICAL = ARM_IIR_BLUR_MODE_VERTICAL
84 | ARM_IIR_BLUR_MODE_REVERSE_VERTICAL,
85} arm_2d_iir_blur_mode_t;
86
88 uint16_t hwB;
89 uint16_t hwG;
90 uint16_t hwR;
92
94
96 uint16_t hwC;
98
100ARM_PRIVATE(
101 implement(arm_2d_op_t); /* inherit from base class arm_2d_op_cp_t*/
102
103 union {
104 uint8_t chBlurMode;
105 struct {
106 uint8_t bForwardHorizontal : 1;
107 uint8_t bForwardVertical : 1;
108 uint8_t bReverseHorizontal : 1;
109 uint8_t bReverseVertical : 1;
110 };
111 };
112
113 uint8_t chBlurDegree;
115
116 arm_2d_scratch_mem_t tScratchMemory;
117
119
120/*============================ GLOBAL VARIABLES ==============================*/
121/*============================ PROTOTYPES ====================================*/
122
123/*!
124 * \brief Apply IIR blur to a specified region on the target tile
125 * \param[in] ptOP the control block
126 * \param[in] ptTarget the target tile
127 * \param[in] ptRegion the target region
128 * \param[in] chBlurDegree the blur degree,
129 * \note - 0~127 works as generic anti-alias, and
130 * - 128~239 works as blur
131 * \return arm_fsm_rt_t the operations result
132 */
133extern
134ARM_NONNULL(1,2)
137 const arm_2d_tile_t *ptTarget,
138 const arm_2d_region_t *ptRegion,
139 uint8_t chBlurDegree);
140
141
142
143/*!
144 * \brief Release the resource used by the given IIR blur
145 * \param[in] ptOP the control block
146 * \return arm_fsm_rt_t the operations result
147 */
148extern
149ARM_NONNULL(1)
152
153/*!
154 * \brief Apply IIR blur to a specified region on the target tile
155 * \param[in] ptOP the control block
156 * \param[in] ptTarget the target tile
157 * \param[in] ptRegion the target region
158 * \param[in] chBlurDegree the blur degree,
159 * \note - 0~127 works as generic anti-alias, and
160 * - 128~239 works as blur
161 * \return arm_fsm_rt_t the operations result
162 */
163extern
164ARM_NONNULL(1,2)
167 const arm_2d_tile_t *ptTarget,
168 const arm_2d_region_t *ptRegion,
169 uint8_t chBlurDegree);
170
171
172
173/*!
174 * \brief Release the resource used by the given IIR blur
175 * \param[in] ptOP the control block
176 * \return arm_fsm_rt_t the operations result
177 */
178extern
179ARM_NONNULL(1)
182
183/*!
184 * \brief Apply IIR blur to a specified region on the target tile
185 * \param[in] ptOP the control block
186 * \param[in] ptTarget the target tile
187 * \param[in] ptRegion the target region
188 * \param[in] chBlurDegree the blur degree,
189 * \note - 0~127 works as generic anti-alias, and
190 * - 128~239 works as blur
191 * \return arm_fsm_rt_t the operations result
192 */
193extern
194ARM_NONNULL(1,2)
197 const arm_2d_tile_t *ptTarget,
198 const arm_2d_region_t *ptRegion,
199 uint8_t chBlurDegree);
200
201
202
203/*!
204 * \brief Release the resource used by the given IIR blur
205 * \param[in] ptOP the control block
206 * \return arm_fsm_rt_t the operations result
207 */
208extern
209ARM_NONNULL(1)
212
213
214
215/*!
216 * \brief set IIR blur working mode
217 * \param[in] ptOP the control block
218 * \param[in] chModeMask working mode ARM_IIR_BLUR_MODE_xxxx
219 * \return none
220 */
221extern
222ARM_NONNULL(1)
224 uint_fast8_t chModeMask);
225
226/*! @} */
227
228#if defined(__clang__)
229# pragma clang diagnostic pop
230#endif
231
232#ifdef __cplusplus
233}
234#endif
235
236
237#endif /* __ARM_2D_FILTER_IIR_BLUR_H__ */