diff --git a/package/Arm2D/Arm2D.c b/package/Arm2D/Arm2D.c index 3de39f75a..70b865ab5 100644 --- a/package/Arm2D/Arm2D.c +++ b/package/Arm2D/Arm2D.c @@ -11,20 +11,6 @@ int Arm2D_is_point_inside_region(PikaObj* self, return arm_2d_is_point_inside_region(_region, _location); } -int Arm2D_is_root_tile(PikaObj* self, PikaObj* tile) { - arm_2d_tile_t* _tile = obj_getStruct(tile, "_self"); - return arm_2d_is_root_tile(_tile); -} - -PikaObj* Arm2D_get_absolute_location(PikaObj* self, PikaObj* tile) { - arm_2d_tile_t* _tile = obj_getStruct(tile, "_self"); - arm_2d_location_t _location = {0}; - arm_2d_get_absolute_location(_tile, &_location); - PikaObj* location = newNormalObj(New_Arm2D_Location); - obj_setStruct(location, "_self", _location); - return location; -} - void Arm2D___init__(PikaObj* self) { int32_t __Arm2D_platform_Init(); __Arm2D_platform_Init(); @@ -36,6 +22,12 @@ void Arm2D___init__(PikaObj* self) { obj_setInt(self, "CP_MODE_X_MIRROR", ARM_2D_CP_MODE_X_MIRROR); obj_setInt(self, "CP_MODE_XY_MIRROR", ARM_2D_CP_MODE_XY_MIRROR); + obj_setInt(self, "COLOR_WHITE", GLCD_COLOR_WHITE); + obj_setInt(self, "COLOR_BLACK", GLCD_COLOR_BLACK); + obj_setInt(self, "COLOR_RED", GLCD_COLOR_RED); + obj_setInt(self, "COLOR_BLUE", GLCD_COLOR_BLUE); + obj_setInt(self, "COLOR_GREEN", GLCD_COLOR_GREEN); + pika_arm2d_init(); } @@ -50,7 +42,11 @@ int Arm2D_tile_copy(PikaObj* self, return arm_2d_tile_copy(_src, _des, _des_reg, mode); } -int Arm2D_alpha_blending(PikaObj *self, PikaObj* src, PikaObj* des, PikaObj* reg, int alp){ +int Arm2D_alpha_blending(PikaObj* self, + PikaObj* src, + PikaObj* des, + PikaObj* reg, + int alp) { arm_2d_tile_t* _src = obj_getStruct(src, "_self"); arm_2d_tile_t* _des = obj_getStruct(des, "_self"); arm_2d_region_t* _reg = obj_getStruct(reg, "_self"); @@ -68,3 +64,31 @@ void Arm2D_update(PikaObj* self) { while (arm_fsm_rt_cpl != arm_2d_helper_pfb_task(&s_tPFBHelper, NULL)) ; } + +PikaObj* Arm2D_create_location(PikaObj* self, int x, int y) { + PikaObj* location = newNormalObj(New_Arm2D_Location); + arm_2d_location_t _location = { + .iX = x, + .iY = y, + }; + obj_setStruct(location, "_self", _location); + return location; +} + +PikaObj* Arm2D_create_region(PikaObj* self, int x, int y, int w, int h) { + PikaObj* region = newNormalObj(New_Arm2D_Region); + arm_2d_region_t _region = { + .tLocation = + { + .iX = x, + .iY = y, + }, + .tSize = + { + .iWidth = w, + .iHeight = h, + }, + }; + obj_setStruct(region, "_self", _region); + return region; +} diff --git a/package/Arm2D/Arm2D.pyi b/package/Arm2D/Arm2D.pyi index abf1186a9..db1768215 100644 --- a/package/Arm2D/Arm2D.pyi +++ b/package/Arm2D/Arm2D.pyi @@ -1,11 +1,35 @@ +class Window: + background = BackGround() + elems = ElementList() + def __init__(self): ... + + def addCallBack(callback: any): + """ + Interface of callback: + ``` callback(frameBuff: Tile, isNewFrame:int) ``` + """ + # origin APIs + CP_MODE_COPY: int CP_MODE_FILL: int CP_MODE_Y_MIRROR: int CP_MODE_X_MIRROR: int CP_MODE_XY_MIRROR: int +COLOR_WHITE: int +COLOR_BLACK: int +COLOR_RED: int +COLOR_BLUE: int +COLOR_GREEN: int + + +def __init__(): ... +def create_region(x: int, y: int, w: int, h: int) -> Region: ... +def create_location(x: int, y: int) -> Location: ... +def update(): ... + class Tile: def __init__(self): ... @@ -16,17 +40,16 @@ class Tile: def shape_compare(self, reference: Region) -> int: ... def region_diff(self, tile: Tile) -> Region: ... def transform(self, reg: Region, centre: Location) -> int: ... - def rotate(self, reg: Region, centre: Location) -> int: ... + def is_root_tile(self) -> int: ... + def get_absolute_location(self) -> Location: ... + def rotation(self, des: Tile, des_reg: Region, centre: Location, angle: float, mask_color: int) -> int: ... -def __init__(): ... def is_point_inside_region(region: Region, location: Location) -> int: ... -def get_absolute_location(tile: Tile) -> Location: ... -def is_root_tile(tile: Tile) -> int: ... def tile_copy(src: Tile, des: Tile, des_reg: Region, mode: int) -> int: ... def alpha_blending(src: Tile, des: Tile, reg: Region, alp: int) -> int: ... def fill_colour(tile: Tile, reg: Region, colour: int) -> int: ... -def update(): ... + class Region: def __init__(self): ... @@ -37,15 +60,12 @@ class Location: def __init__(self): ... -class Corner(Tile): - def __init__(self): ... - - -class WhiteDotAlpha(Tile): +class Star(Tile): def __init__(self): ... # high level APIs + class BackGround: def __init__(self): ... def setColor(self, color: str): ... @@ -74,9 +94,3 @@ class Box(Element): def __init__(self): ... def setColor(self, color: str): ... def setSize(self, x: int, y: int): ... - - -class Window: - background = BackGround() - elems = ElementList() - def __init__(self): ... diff --git a/package/Arm2D/Arm2D_Background.c b/package/Arm2D/Arm2D_Background.c index 056ee1056..a55ebe09c 100644 --- a/package/Arm2D/Arm2D_Background.c +++ b/package/Arm2D/Arm2D_Background.c @@ -9,7 +9,7 @@ char* Arm2D_BackGround_getColor(PikaObj* self) { } void Arm2D_BackGround_update(PikaObj* self) { - void* target_tile = pika_arm2d_window.pfb_tile_now; + void* target_tile = pika_arm2d_globals.pfb_tile_now; char* color = obj_getStr(self, "color"); uint16_t backGroundColor = getColorCode(color); diff --git a/package/Arm2D/Arm2D_Box.c b/package/Arm2D/Arm2D_Box.c index a7bf8431c..e91f5a1ab 100644 --- a/package/Arm2D/Arm2D_Box.c +++ b/package/Arm2D/Arm2D_Box.c @@ -23,8 +23,8 @@ int __max(int x, int y) { } void Arm2D_Box_update(PikaObj* self) { - void* target_tile = pika_arm2d_window.pfb_tile_now; - bool bIsNewFrame = pika_arm2d_window.pfb_is_new_frame; + void* target_tile = pika_arm2d_globals.pfb_tile_now; + bool bIsNewFrame = pika_arm2d_globals.pfb_is_new_frame; arm_2d_region_t arg2d_regin = {0}; arg2d_regin.tSize.iHeight = obj_getInt(self, "height"); diff --git a/package/Arm2D/Arm2D_Tile.c b/package/Arm2D/Arm2D_Tile.c index 3da8d5388..a0b148444 100644 --- a/package/Arm2D/Arm2D_Tile.c +++ b/package/Arm2D/Arm2D_Tile.c @@ -1,6 +1,6 @@ #include "Arm2D_Tile.h" -#include "Arm2D_Corner.h" -#include "Arm2D_WhiteDotAlpha.h" +#include "Arm2D_Location.h" +#include "Arm2D_Star.h" #include "Arm2D_Region.h" #include "Arm2D_common.h" @@ -63,16 +63,6 @@ int Arm2D_Tile_width_compare(PikaObj* self, PikaObj* reference) { return arm_2d_tile_width_compare(_self, _reference); } -void Arm2D_Corner___init__(PikaObj *self){ - extern arm_2d_tile_t s_tCorner; - obj_setStruct(self, "_self", s_tCorner); -} - -void Arm2D_WhiteDotAlpha___init__(PikaObj *self){ - extern arm_2d_tile_t c_tileWhiteDotAlphaQuarter; - obj_setStruct(self, "_self", c_tileWhiteDotAlphaQuarter); -} - int Arm2D_Tile_transform(PikaObj *self, PikaObj* reg, PikaObj* centre){ arm_2d_tile_t* _self = obj_getStruct(self, "_self"); arm_2d_region_t* _reg = obj_getStruct(reg, "_self"); @@ -80,10 +70,29 @@ int Arm2D_Tile_transform(PikaObj *self, PikaObj* reg, PikaObj* centre){ return arm_2d_tile_transform(_self, _reg, _centre); } - -int Arm2D_Tile_rotate(PikaObj *self, PikaObj* reg, PikaObj* centre){ +int Arm2D_Tile_is_root_tile(PikaObj *self){ arm_2d_tile_t* _self = obj_getStruct(self, "_self"); - arm_2d_region_t* _reg = obj_getStruct(reg, "_self"); - arm_2d_location_t* _centre = obj_getStruct(centre, "_self"); - return arm_2d_tile_rotate(_self, _reg, _centre); + return arm_2d_is_root_tile(_self); +} + +PikaObj* Arm2D_Tile_get_absolute_location(PikaObj *self){ + arm_2d_tile_t* _self = obj_getStruct(self, "_self"); + arm_2d_location_t _location = {0}; + arm_2d_get_absolute_location(_self, &_location); + PikaObj* location = newNormalObj(New_Arm2D_Location); + obj_setStruct(location, "_self", _location); + return location; +} + +void Arm2D_Star___init__(PikaObj *self){ + extern arm_2d_tile_t c_tilePictureSunRGB565; + obj_setStruct(self, "_self", c_tilePictureSunRGB565); +} + +int Arm2D_Tile_rotation(PikaObj *self, PikaObj* des, PikaObj* des_reg, PikaObj* centre, double angle, int mask_color){ + arm_2d_tile_t* _self = obj_getStruct(self, "_self"); + arm_2d_tile_t* _des = obj_getStruct(des, "_self"); + arm_2d_region_t* _des_reg = obj_getStruct(des_reg, "_self"); + arm_2d_location_t* _centre = obj_getStruct(centre, "_self"); + return arm_2d_tile_rotation(_self, _des, _des_reg, *_centre, angle, mask_color); } diff --git a/package/Arm2D/Arm2D_Window.c b/package/Arm2D/Arm2D_Window.c index 9ccf2917f..5cb56042a 100644 --- a/package/Arm2D/Arm2D_Window.c +++ b/package/Arm2D/Arm2D_Window.c @@ -1,16 +1,25 @@ #include "Arm2D_Window.h" #include "Arm2D_Background.h" #include "Arm2D_ElementList.h" +#include "Arm2D_Tile.h" #include "Arm2D_common.h" #include "arm_2d.h" #include "arm_2d_helper.h" #include "pikaScript.h" -pika_arm2d_window_t pika_arm2d_window; +pika_arm2d_globals_t pika_arm2d_globals; arm_2d_helper_pfb_t s_tPFBHelper; -static IMPL_PFB_ON_LOW_LV_RENDERING(__pfb_render_handler) { +int32_t __Arm2D_platform_drawRegin(uint32_t x, + uint32_t y, + uint32_t width, + uint32_t height, + const uint8_t* bitmap); + +static void __pfb_render_handler(void* pTarget, + const arm_2d_pfb_t* ptPFB, + bool bIsNewFrame) { const arm_2d_tile_t* pfb_tile = &(ptPFB->tTile); ARM_2D_UNUSED(pTarget); @@ -25,30 +34,61 @@ static IMPL_PFB_ON_LOW_LV_RENDERING(__pfb_render_handler) { (arm_2d_pfb_t*)ptPFB); } -static IMPL_PFB_ON_DRAW(pika_pfb_drow_window_hanlder) { - ARM_2D_UNUSED(pTarget); - ARM_2D_UNUSED(bIsNewFrame); +static void Arm2D_callback_update(void) { + PikaObj* self = pika_arm2d_globals.pika_windows_object; + if (obj_getInt(self, "callback_exist") == 1) { + PikaObj* __frameBuffer = obj_getPtr(self, "__frameBuffer"); + obj_setStruct(__frameBuffer, "_self", *pika_arm2d_globals.pfb_tile_now); + obj_setInt(self, "__isNewFrame", pika_arm2d_globals.pfb_is_new_frame); + /* clang-format off */ + PIKA_PYTHON( + __callback(__frameBuffer, __isNewFrame) + ) + /* clang-format on */ + const uint8_t bytes[] = { + 0x0c, 0x00, /* instruct array size */ + 0x10, 0x81, 0x01, 0x00, 0x10, 0x01, 0x0f, 0x00, 0x00, 0x02, 0x1c, + 0x00, + /* instruct array */ + 0x27, 0x00, /* const pool size */ + 0x00, 0x5f, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x42, 0x75, 0x66, + 0x66, 0x65, 0x72, 0x00, 0x5f, 0x5f, 0x69, 0x73, 0x4e, 0x65, 0x77, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x00, 0x5f, 0x5f, 0x63, 0x61, 0x6c, + 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x00, /* const pool */ + }; + pikaVM_runByteCode(self, (uint8_t*)bytes); + } +} - pika_arm2d_window.pfb_tile_now = (arm_2d_tile_t*)ptTile; - pika_arm2d_window.pfb_is_new_frame = bIsNewFrame; - PikaObj* background = pika_arm2d_window.pika_background_object; - PikaObj* elems = pika_arm2d_window.pika_elems_object; +static arm_fsm_rt_t pika_pfb_drow_window_hanlder( + void* pTarget, + const arm_2d_tile_t* frameBuffer, + bool isNewFrame) { + ARM_2D_UNUSED(pTarget); + + pika_arm2d_globals.pfb_tile_now = (arm_2d_tile_t*)frameBuffer; + pika_arm2d_globals.pfb_is_new_frame = isNewFrame; + PikaObj* background = pika_arm2d_globals.pika_background_object; + PikaObj* elems = pika_arm2d_globals.pika_elems_object; Arm2D_BackGround_update(background); Arm2D_ElementList_update(elems); + Arm2D_callback_update(); return arm_fsm_rt_cpl; } void pika_arm2d_init(void) { - arm_irq_safe { arm_2d_init(); } + arm_irq_safe { + arm_2d_init(); + } //! initialise FPB helper if (ARM_2D_HELPER_PFB_INIT( - &s_tPFBHelper, //!< FPB Helper object - ARM2D_LCD_WIDTH, //!< screen width - ARM2D_LCD_HEIGHT, //!< screen height - uint16_t, //!< colour date type - ARM2D_PFB_BLOCK_WIDTH, //!< PFB block width + &s_tPFBHelper, //!< FPB Helper object + ARM2D_LCD_WIDTH, //!< screen width + ARM2D_LCD_HEIGHT, //!< screen height + uint16_t, //!< colour date type + ARM2D_PFB_BLOCK_WIDTH, //!< PFB block width ARM2D_PFB_BLOCK_HEIGHT, //!< PFB block height - 1, //!< number of PFB in the PFB pool + 1, //!< number of PFB in the PFB pool { .evtOnLowLevelRendering = { @@ -67,9 +107,16 @@ void pika_arm2d_init(void) { } void Arm2D_Window___init__(PikaObj* self) { - pika_arm2d_window.pika_windows_object = self; - pika_arm2d_window.pika_elems_object = obj_getObj(self, "elems"); - pika_arm2d_window.pika_background_object = - obj_getObj(self, "background"); - pika_arm2d_window.dirty_region_list = NULL; + obj_setInt(self, "callback_exist", 0); + PikaObj* __frameBuffer = newNormalObj(New_Arm2D_Tile); + obj_setPtr(self, "__frameBuffer", __frameBuffer); + pika_arm2d_globals.pika_windows_object = self; + pika_arm2d_globals.pika_elems_object = obj_getObj(self, "elems"); + pika_arm2d_globals.pika_background_object = obj_getObj(self, "background"); + pika_arm2d_globals.dirty_region_list = NULL; +} + +void Arm2D_Window_addCallBack(PikaObj* self, Arg* callback) { + obj_setInt(self, "callback_exist", 1); + obj_setArg(self, "__callback", callback); } diff --git a/package/Arm2D/Arm2D_common.h b/package/Arm2D/Arm2D_common.h index bc198f94a..209813123 100644 --- a/package/Arm2D/Arm2D_common.h +++ b/package/Arm2D/Arm2D_common.h @@ -26,16 +26,16 @@ typedef struct __pika_arm2d_box_info_t { uint16_t color_code, color_code_last; } pika_arm2d_box_info_t; -typedef struct __pika_arm2d_window_t { +typedef struct __pika_arm2d_globals_t { arm_2d_tile_t* pfb_tile_now; bool pfb_is_new_frame; arm_2d_region_list_item_t* dirty_region_list; PikaObj* pika_windows_object; PikaObj* pika_background_object; PikaObj* pika_elems_object; -} pika_arm2d_window_t; +} pika_arm2d_globals_t; -extern pika_arm2d_window_t pika_arm2d_window; +extern pika_arm2d_globals_t pika_arm2d_globals; /* GLCD RGB color definitions */ #define GLCD_COLOR_BLACK 0x0000 /* 0, 0, 0 */ @@ -71,7 +71,7 @@ typedef struct { } rotate_tile_t; #define __implement_tile(__NAME, __WIDTH, __HEIGHT, __TYPE, ...) \ - ARM_NOINIT static __TYPE \ + static __TYPE \ __NAME##Buffer[(__WIDTH) * (__HEIGHT)]; \ const arm_2d_tile_t __NAME = { \ .tRegion = { \ @@ -149,6 +149,10 @@ typedef struct { arm_2dp_gray8_tile_rotation_with_src_mask_and_opacity # define arm_2dp_tile_rotation_with_src_mask \ arm_2dp_gray8_tile_rotation_with_src_mask + +# define arm_2d_tile_rotation \ + arm_2d_gray8_tile_rotation + #elif __GLCD_CFG_COLOUR_DEPTH__ == 16 # define __arm_2d_color_t arm_2d_color_rgb565_t @@ -207,6 +211,10 @@ typedef struct { arm_2dp_rgb565_tile_rotation_with_src_mask_and_opacity # define arm_2dp_tile_rotation_with_src_mask \ arm_2dp_rgb565_tile_rotation_with_src_mask + + +# define arm_2d_tile_rotation \ + arm_2d_rgb565_tile_rotation #elif __GLCD_CFG_COLOUR_DEPTH__ == 32 # define __arm_2d_color_t arm_2d_color_cccn888_t @@ -265,6 +273,10 @@ typedef struct { arm_2dp_cccn888_tile_rotation_with_src_mask_and_opacity # define arm_2dp_tile_rotation_with_src_mask \ arm_2dp_cccn888_tile_rotation_with_src_mask + +# define arm_2d_tile_rotation \ + arm_2d_cccn888_tile_rotation + #else # error Unsupported colour depth! #endif diff --git a/package/Arm2D/Helper/Include/arm_2d_disp_adapters.h b/package/Arm2D/Helper/Include/arm_2d_disp_adapters.h deleted file mode 100644 index e5948594f..000000000 --- a/package/Arm2D/Helper/Include/arm_2d_disp_adapters.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2009-2022 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d_dis_adapters.h" - * Description: Public header file to include all display adapter header files - * - * $Date: 12. Aug 2022 - * $Revision: V.1.0.0 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_DISP_ADAPTERS_H__ -#define __ARM_2D_DISP_ADAPTERS_H__ - -/*============================ INCLUDES ======================================*/ - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER0__ -# include "arm_2d_disp_adapter_0.h" -#endif - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER1__ -# include "arm_2d_disp_adapter_1.h" -#endif - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER2__ -# include "arm_2d_disp_adapter_2.h" -#endif - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER3__ -# include "arm_2d_disp_adapter_3.h" -#endif - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER4__ -# include "arm_2d_disp_adapter_4.h" -#endif - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER5__ -# include "arm_2d_disp_adapter_5.h" -#endif - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER6__ -# include "arm_2d_disp_adapter_6.h" -#endif - -#ifdef __RTE_ACCELERATION_ARM_2D_HELPER_DISP_ADAPTER7__ -# include "arm_2d_disp_adapter_7.h" -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - - -#endif diff --git a/package/Arm2D/Helper/Include/arm_2d_helper.h b/package/Arm2D/Helper/Include/arm_2d_helper.h deleted file mode 100644 index 06c1a4e14..000000000 --- a/package/Arm2D/Helper/Include/arm_2d_helper.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d_helper.h" - * Description: Public header file for the all helper services - * - * $Date: 03. Sept 2022 - * $Revision: V.1.2.0 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_HELPER_H__ -#define __ARM_2D_HELPER_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d.h" -#include "./arm_2d_helper_pfb.h" -#include "./arm_2d_helper_scene.h" -#include "./arm_2d_disp_adapters.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wunused-function" -#endif - - -/*! - * \addtogroup gHelper 7 Helper Services - * @{ - */ -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ - -#define __declare_tile(__name) \ - extern const arm_2d_tile_t __name; -#define declare_tile(__name) __declare_tile(__name) - -#define dcl_tile(__name) declare_tile(__name) -#define dcl_fb(__name) declare_tile(__name) - - -#define __impl_fb(__NAME, __WIDTH, __HEIGHT, __TYPE, ...) \ - ARM_NOINIT static __TYPE \ - __NAME##Buffer[(__WIDTH) * (__HEIGHT)]; \ - const arm_2d_tile_t __NAME = { \ - .tRegion = { \ - .tSize = {(__WIDTH), (__HEIGHT)}, \ - }, \ - .tInfo.bIsRoot = true, \ - .pchBuffer = (uint8_t *)__NAME##Buffer, \ - __VA_ARGS__ \ - }; - -#define impl_fb(__NAME, __WIDTH, __HEIGHT, __TYPE, ...) \ - __impl_fb(__NAME, __WIDTH, __HEIGHT, __TYPE, ##__VA_ARGS__) - -#define get_tile_buffer_pixel_count(__NAME) \ - (uint32_t)( (__NAME.tRegion.tSize.iWidth) \ - * (__NAME.tRegion.tSize.iHeight)) - -#define get_tile_buffer_size(__NAME, __TYPE) \ - (get_2d_layer_buffer_pixel_count(__NAME) * sizeof(TYPE)) - - -#define impl_child_tile(__PARENT, __X, __Y, __WIDTH, __HEIGHT, ...) { \ - .tRegion = { \ - .tLocation = { \ - .iX = (__X), \ - .iY = (__Y), \ - }, \ - .tSize = { \ - .iWidth = (__WIDTH), \ - .iHeight = (__HEIGHT), \ - }, \ - }, \ - .tInfo.bIsRoot = false, \ - .tInfo.bDerivedResource = true, \ - .ptParent = (arm_2d_tile_t *)&(__PARENT), \ - __VA_ARGS__ \ - } - -#define __arm_2d_align_centre2(__region, __size) \ - for (arm_2d_region_t __centre_region = { \ - .tSize = (__size), \ - .tLocation = { \ - .iX = ((__region).tSize.iWidth - (__size).iWidth) >> 1,\ - .iY = ((__region).tSize.iHeight - (__size).iHeight)>> 1,\ - }, \ - }, \ - *ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr) = NULL; \ - ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr)++ == NULL; \ - arm_2d_op_wait_async(NULL) \ - ) - -#define __arm_2d_align_centre3(__region, __width, __height) \ - for (arm_2d_region_t __centre_region = { \ - .tSize = { \ - .iWidth = (__width), \ - .iHeight = (__height), \ - }, \ - .tLocation = { \ - .iX = ((__region).tSize.iWidth - (__width)) >> 1, \ - .iY = ((__region).tSize.iHeight - (__height))>> 1, \ - }, \ - }, \ - *ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr) = NULL; \ - ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr)++ == NULL; \ - arm_2d_op_wait_async(NULL) \ - ) - -#define arm_2d_align_centre(...) \ - ARM_CONNECT2( __arm_2d_align_centre, \ - __ARM_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) - -/*! - * \brief set an alarm with given period and check the status - * - * \param[in] wMS a time period in millisecond - * \param[in] ... an optional timestamp holder - * - * \return bool whether it is timeout - */ -#define arm_2d_helper_is_time_out(__MS, ...) \ - __arm_2d_helper_is_time_out((__MS), (NULL, ##__VA_ARGS__)) - -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ PROTOTYPES ====================================*/ - -__STATIC_INLINE bool __arm_2d_helper_is_time_out(uint32_t wMS, int64_t *plTimestamp) -{ - int64_t lTimestamp = arm_2d_helper_get_system_timestamp(); - static int64_t s_lTimestamp = 0; - if (NULL == plTimestamp) { - plTimestamp = &s_lTimestamp; - } - - if (0 == *plTimestamp) { - *plTimestamp = arm_2d_helper_convert_ms_to_ticks(wMS); - *plTimestamp += lTimestamp; - - return false; - } - - if (lTimestamp >= *plTimestamp) { - *plTimestamp = arm_2d_helper_convert_ms_to_ticks(wMS) + lTimestamp; - return true; - } - - return false; -} - -/*! @} */ - -#if defined(__clang__) -# pragma clang diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Helper/Include/arm_2d_helper_pfb.h b/package/Arm2D/Helper/Include/arm_2d_helper_pfb.h deleted file mode 100644 index 2986c248e..000000000 --- a/package/Arm2D/Helper/Include/arm_2d_helper_pfb.h +++ /dev/null @@ -1,625 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d_helper_pfb.h" - * Description: Public header file for the PFB helper service - * - * $Date: 29. Aug 2022 - * $Revision: V.1.2.0 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_HELPER_PFB_H__ -#define __ARM_2D_HELPER_PFB_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wpadded" -#endif - - -/*! - * \addtogroup gHelper 7 Helper Services - * @{ - */ - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ - -/*! - * \brief a macro wrapper in uppercase to help initialising PFB service - * \param[in] __CB_ADDR the address of the arm_2d_helper_pfb_t object - * \param[in] __SCREEN_WIDTH the width of the screen - * \param[in] __SCREEN_HEIGHT the hight of the screen - * \param[in] __PIXEL_TYPE the integer type of the pixel, i.e. uint8_t, uint16_t, - * uint32_t - * \param[in] __WIDTH the width of the PFB block - * \param[in] __HEIGHT the height of the PFB block - * \note For the same number of pixels in a PFB block, please priority the width - * over height, for example, 240 * 1 is better than 30 * 8 - * \param[in] __PFB_NUM the number of PFB blocks in the built-in PFB pool. - * \param[in] ... a code block to add additional initializer, see example below: - * \return arm_2d_err_t the result of the initialisation process - * - * \code {.c} - - static ARM_NOINIT arm_2d_helper_pfb_t s_tExamplePFB; - ... - // initialise FPB helper - if (ARM_2D_HELPER_PFB_INIT( - &s_tExamplePFB, // FPB Helper object - __GLCD_CFG_SCEEN_WIDTH__, // screen width - __GLCD_CFG_SCEEN_HEIGHT__, // screen height - uint16_t, // colour date type - 240, // PFB block width - 1, // PFB block height - 1, // number of PFB in the PFB pool - { - .evtOnLowLevelRendering = { - // callback for low level rendering - .fnHandler = &__pfb_render_handler, - }, - .evtOnDrawing = { - // callback for drawing GUI - .fnHandler = &__pfb_draw_background_handler, - }, - }, - //.FrameBuffer.bSwapRGB16 = true, - ) < 0) { - //! error detected - assert(false); - } - * \endcode - * - */ -#define ARM_2D_HELPER_PFB_INIT( __CB_ADDR, /* PFB Helper object address */ \ - __SCREEN_WIDTH, /* Screen width */ \ - __SCREEN_HEIGHT,/* Screen height */ \ - __PIXEL_TYPE, /* The type of the pixels */ \ - __WIDTH, /* The width of the PFB block */\ - __HEIGHT, /* The height of the PFB block*/\ - __PFB_NUM, /* Block count in the PFB pool*/\ - ... /* Event Handler */ \ - ) \ - ({ \ - __attribute__((section(".bss.noinit.arm_2d_pfb_pool"))) \ - static struct { \ - arm_2d_pfb_t tFPB; \ - __ALIGNED(4) \ - __PIXEL_TYPE tBuffer[(__WIDTH) * (__HEIGHT)]; \ - } s_tPFBs[__PFB_NUM]; \ - \ - arm_2d_helper_pfb_cfg_t tCFG = { \ - .tDisplayArea.tSize = { \ - .iWidth = (__SCREEN_WIDTH), \ - .iHeight = (__SCREEN_HEIGHT), \ - }, \ - \ - .FrameBuffer.ptPFBs = (arm_2d_pfb_t *)s_tPFBs, \ - .FrameBuffer.tFrameSize = { \ - .iWidth = (__WIDTH), \ - .iHeight = (__HEIGHT), \ - }, \ - .FrameBuffer.wBufferSize = sizeof(s_tPFBs[0].tBuffer), \ - .FrameBuffer.hwPFBNum = dimof(s_tPFBs), \ - .Dependency = \ - __VA_ARGS__ \ - }; \ - \ - arm_2d_helper_pfb_init((__CB_ADDR), &tCFG); \ - }) - -/*! - * \brief a macro wrapper to update the evtOnDrawring event handler - * \param[in] __CB_ADDR the address of the arm_2d_helper_pfb_t object - * \param[in] __HANDLER the new handler - * \param[in] ... [Optional] an address (of user defined structure) passed to the - * event handler. - * \return arm_2d_err_t the process result - */ -#define ARM_2D_HELPER_PFB_UPDATE_ON_DRAW_HANDLER( \ - __CB_ADDR, /* PFB Helper object address */ \ - __HANDLER, /* new on-draw-handler function*/\ - ...) /* An optional target address */ \ - arm_2d_helper_pfb_update_dependency((__CB_ADDR), \ - ARM_2D_PFB_DEPEND_ON_DRAWING, \ - (arm_2d_helper_pfb_dependency_t []) {{ \ - .evtOnDrawing = { \ - .fnHandler = (__HANDLER), \ - .pTarget = (NULL,##__VA_ARGS__),\ - }, \ - }}) - - -#define __IMPL_ARM_2D_REGION_LIST(__NAME, ...) \ - enum { \ - __NAME##_offset = __COUNTER__, \ - }; \ - __VA_ARGS__ \ - arm_2d_region_list_item_t __NAME[] = { - - -#define IMPL_ARM_2D_REGION_LIST(__NAME, ...) \ - __IMPL_ARM_2D_REGION_LIST(__NAME,##__VA_ARGS__) - - -#define END_IMPL_ARM_2D_REGION_LIST(...) \ - }; - -#define __ADD_REGION_TO_LIST(__NAME, ...) \ - { \ - .ptNext = (arm_2d_region_list_item_t *) \ - &(__NAME[__COUNTER__ - __NAME##_offset]), \ - .tRegion = { \ - __VA_ARGS__ \ - }, \ - } - -#define ADD_REGION_TO_LIST(__NAME, ...) \ - __ADD_REGION_TO_LIST(__NAME, ##__VA_ARGS__) - - -#define __ADD_LAST_REGION_TO_LIST(__NAME, ...) \ - { \ - .ptNext = NULL, \ - .tRegion = { \ - __VA_ARGS__ \ - }, \ - } - -#define ADD_LAST_REGION_TO_LIST(__NAME, ...) \ - __ADD_LAST_REGION_TO_LIST(__NAME, ##__VA_ARGS__) - -#define IMPL_PFB_ON_DRAW(__NAME) \ - arm_fsm_rt_t __NAME(void *pTarget, \ - const arm_2d_tile_t *ptTile, \ - bool bIsNewFrame) - -#define IMPL_PFB_ON_LOW_LV_RENDERING(__NAME) \ - void __NAME(void *pTarget, \ - const arm_2d_pfb_t *ptPFB, \ - bool bIsNewFrame) - - -#define IMPL_PFB_ON_FRAME_SYNC_UP(__NAME) \ - bool __NAME(void *pTarget) - - -/*! - * \brief a macro wrapper in lowercase to help initialising PFB service - * \param[in] __CB_ADDR the address of the arm_2d_helper_pfb_t object - * \param[in] __SCREEN_WIDTH the width of the screen - * \param[in] __SCREEN_HEIGHT the hight of the screen - * \param[in] __PIXEL_TYPE the integer type of the pixel, i.e. uint8_t, uint16_t, - * uint32_t - * \param[in] __WIDTH the width of the PFB block - * \param[in] __HEIGHT the height of the PFB block - * \note For the same number of pixels in a PFB block, please priority the width - * over height, for example, 240 * 1 is better than 30 * 8 - * \param[in] __PFB_NUM the number of PFB blocks in the built-in PFB pool. - * \param[in] ... a code block to add additional initializer, see example below: - * \return arm_2d_err_t the result of the initialisation process - * - * \code {.c} - - static ARM_NOINIT arm_2d_helper_pfb_t s_tExamplePFB; - ... - // initialise FPB helper - if (init_arm_2d_helper_pfb( - &s_tExamplePFB, // FPB Helper object - __GLCD_CFG_SCEEN_WIDTH__, // screen width - __GLCD_CFG_SCEEN_HEIGHT__, // screen height - uint16_t, // colour date type - 240, // PFB block width - 1, // PFB block height - 1, // number of PFB in the PFB pool - { - .evtOnLowLevelRendering = { - // callback for low level rendering - .fnHandler = &__pfb_render_handler, - }, - .evtOnDrawing = { - // callback for drawing GUI - .fnHandler = &__pfb_draw_background_handler, - }, - }, - //.FrameBuffer.bSwapRGB16 = true, - ) < 0) { - //! error detected - assert(false); - } - * \endcode - * - */ -#define init_arm_2d_helper_pfb( __CB_ADDR, \ - __SCREEN_WIDTH, \ - __SCREEN_HEIGHT, \ - __PIXEL_TYPE, \ - __WIDTH, \ - __HEIGHT, \ - __PFB_NUM, \ - ... \ - ) \ - ARM_2D_HELPER_PFB_INIT( \ - __CB_ADDR, \ - __SCREEN_WIDTH, \ - __SCREEN_HEIGHT, \ - __PIXEL_TYPE, \ - __WIDTH, \ - __HEIGHT, \ - __PFB_NUM, \ - ##__VA_ARGS__ \ - ) - -/*! - * \brief a macro wrapper to update the evtOnDrawring event handler - * \param[in] __CB_ADDR the address of the arm_2d_helper_pfb_t object - * \param[in] __HANDLER the new handler - * \param[in] ... [Optional] an address (of user defined structure) passed to the - * event handler. - * \return arm_2d_err_t the process result - */ -#define update_arm_2d_helper_pfb_on_draw_handler( \ - __CB_ADDR, /* PFB Helper object address */ \ - __HANDLER, /* new on-draw-handler function*/\ - ...) /* An optional target address */ \ - ARM_2D_HELPER_PFB_UPDATE_ON_DRAW_HANDLER( \ - (__CB_ADDR), \ - (__HANDLER),##__VA_ARGRS__) - -#define impl_arm_2d_region_list(__NAME, ...) \ - IMPL_ARM_2D_REGION_LIST(__NAME,##__VA_ARGS__) -#define add_region_to_list(__NAME, ...) \ - ADD_REGION_TO_LIST(__NAME, ##__VA_ARGS__) -#define add_last_region_to_list(__NAME, ...) \ - ADD_LAST_REGION_TO_LIST(__NAME, ##__VA_ARGS__) -#define end_impl_arm_2d_region_list(...) \ - END_IMPL_ARM_2D_REGION_LIST(__VA_ARGS__) - -#define impl_pfb_on_draw(__NAME) IMPL_PFB_ON_DRAW(__NAME) -#define impl_pfb_on_low_lv_rendering(__NAME) \ - IMPL_PFB_ON_LOW_LV_RENDERING(__NAME) - -/*============================ TYPES =========================================*/ - -typedef struct arm_2d_helper_pfb_t arm_2d_helper_pfb_t; -/*! - * \brief the header of a PFB block - */ -typedef struct arm_2d_pfb_t { - struct arm_2d_pfb_t *ptNext; //!< next pfb block - arm_2d_helper_pfb_t *ptPFBHelper; //!< the pfb helper service current PFB block comes from - arm_2d_tile_t tTile; //!< descriptor - uint32_t u24Size : 24; - uint32_t : 7; - uint32_t bIsNewFrame : 1; //!< a flag to indicate the starting of a frame -}arm_2d_pfb_t; - -/*! - * \brief the node of a region list - * - */ -typedef struct arm_2d_region_list_item_t { - struct arm_2d_region_list_item_t *ptNext; //!< the next node - arm_2d_region_t tRegion; //!< the region -}arm_2d_region_list_item_t; - -/*! - * \brief the On-Drawing event handler for application layer - * - * \param[in] pTarget a user attached target address - * \param[in] ptTile a tile for the virtual screen - * \param[in] bIsNewFrame a flag indicate the starting of a new frame - * \return arm_fsm_rt_t the status of the FSM. - */ -typedef arm_fsm_rt_t arm_2d_helper_draw_handler_t( - void *pTarget, - const arm_2d_tile_t *ptTile, - bool bIsNewFrame); - -/*! - * \brief the On Low Level Rendering event handler for the low level (LCD Driver) - * - * \param[in] pTarget a user attached target address - * \param[in] ptPFB the PFB block - * \param[in] bIsNewFrame a flag indicate the starting of a new frame - */ -typedef void arm_2d_helper_render_handler_t( - void *pTarget, - const arm_2d_pfb_t *ptPFB, - bool bIsNewFrame); - -/*! - * \brief on low level render event - */ -typedef struct arm_2d_helper_render_evt_t { - arm_2d_helper_render_handler_t *fnHandler; //!< event handler function - void *pTarget; //!< user attached target -} arm_2d_helper_render_evt_t; - -/*! - * \brief on drawing event - */ -typedef struct arm_2d_helper_draw_evt_t { - arm_2d_helper_draw_handler_t *fnHandler; //!< event handler function - void *pTarget; //!< user attached target -} arm_2d_helper_draw_evt_t; - -/*! - * \brief the enumeration for events - * - */ -enum { - ARM_2D_PFB_DEPEND_ON_LOW_LEVEL_RENDERING = _BV(0), //!< On Low Level Rendering Event - ARM_2D_PFB_DEPEND_ON_DRAWING = _BV(1), //!< On Drawing Event - ARM_2D_PFB_DEPEND_ON_LOW_LEVEL_SYNC_UP = _BV(2), //!< On Low Level Sync-up Event - ARM_2D_PFB_DEPEND_ON_FRAME_SYNC_UP = _BV(3), //!< On Frame Sync-up Event -}; - -/*! - * \brief The PFB Helper Service Dependency - * - */ -typedef struct arm_2d_helper_pfb_dependency_t { - //! event handler for low level rendering - arm_2d_helper_render_evt_t evtOnLowLevelRendering; - - //! event handler for drawing GUI - arm_2d_helper_draw_evt_t evtOnDrawing; - - //! low level rendering handler wants to sync-up (return arm_fsm_rt_wait_for_obj) - arm_2d_evt_t evtOnLowLevelSyncUp; - -} arm_2d_helper_pfb_dependency_t; - -/*! - * \brief PFB Helper configuration - * - */ -typedef struct arm_2d_helper_pfb_cfg_t { - - arm_2d_region_t tDisplayArea; //!< screen description - - struct { - arm_2d_pfb_t *ptPFBs; //!< current PFB block - arm_2d_size_t tFrameSize; //!< the size of the frame - uint32_t wBufferSize; //!< the buffer size - uint16_t hwPFBNum; //!< the number of PFB - uint16_t bDoNOTUpdateDefaultFrameBuffer : 1; //!< A flag to disable automatically default-framebuffer-registration - uint16_t bDisableDynamicFPBSize : 1; //!< A flag to disable resize of the PFB block - uint16_t bSwapRGB16 : 1; //!< A flag to enable swapping high and low bytes of an RGB16 pixel - uint16_t : 9; - uint16_t u4PoolReserve : 4; //!< reserve specific number of PFB for other helper services - - } FrameBuffer; //!< frame buffer context - - arm_2d_helper_pfb_dependency_t Dependency; //!< user registered dependency - -} arm_2d_helper_pfb_cfg_t; - -/*! - * \brief the PFB helper control block - * - */ -struct arm_2d_helper_pfb_t{ - -ARM_PRIVATE( - arm_2d_helper_pfb_cfg_t tCFG; //!< user configuration - - struct { - arm_2d_region_t tDrawRegion; - arm_2d_region_t tTargetRegion; - arm_2d_region_list_item_t *ptDirtyRegion; - arm_2d_tile_t tPFBTile; - arm_2d_size_t tFrameSize; - bool bFirstIteration; - bool bIsRegionChanged; - uint8_t chPT; - struct { - uint8_t bIsNewFrame : 1; - uint8_t bIsFlushRequested :1; - }; - uint16_t hwFreePFBCount; - arm_2d_pfb_t *ptCurrent; - arm_2d_pfb_t *ptFreeList; - - struct { - arm_2d_pfb_t *ptHead; - arm_2d_pfb_t *ptTail; - }FlushFIFO; - arm_2d_tile_t *ptFrameBuffer; - } Adapter; -) - - struct { - int64_t lTimestamp; //!< PLEASE DO NOT USE - int32_t nTotalCycle; //!< cycles used by drawing - int32_t nRenderingCycle; //!< cycles used in LCD flushing - } Statistics; //!< performance statistics - -}; - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*! - * \brief initialize pfb helper service - * \param[in] ptThis the pfb helper control block - * \param[in] ptCFG the configuration - * \return arm_2d_err_t the process result - */ -extern -ARM_NONNULL(1,2) -arm_2d_err_t arm_2d_helper_pfb_init(arm_2d_helper_pfb_t *ptThis, - arm_2d_helper_pfb_cfg_t *ptCFG); - -/*! - * \brief get the display (screen) region - * \param[in] ptThis the pfb helper control block - * \return arm_2d_region_t the screen region - */ -extern -ARM_NONNULL(1) -arm_2d_region_t arm_2d_helper_pfb_get_display_area(arm_2d_helper_pfb_t *ptThis); - -/*! - * \brief the task function for pfb helper - * \param[in] ptThis an initialised PFB control block - * \param[in] ptDirtyRegions a region list pending for refresh, NULL means - * refreshing the whole screen - * \retval arm_fsm_rt_cpl complete refreshing one frame - * \retval arm_fsm_rt_on_going the refreshing work is on-going - * \retval arm_fsm_rt_wait_for_obj user's OnDrawing event handler wants to wait - * for some objects, e.g. semaphore etc. - * \retval <0 An error is detected - */ -extern -ARM_NONNULL(1) -arm_fsm_rt_t arm_2d_helper_pfb_task(arm_2d_helper_pfb_t *ptThis, - arm_2d_region_list_item_t *ptDirtyRegions); - -/*! - * \brief flush the FPB FIFO - * \note This function is THREAD-SAFE - * \note For normal usage, please DO NOT use this function unless you know what - * you are doing. - * \param[in] ptThis an initialised PFB control block - */ -extern -ARM_NONNULL(1) -void arm_2d_helper_pfb_flush(arm_2d_helper_pfb_t *ptThis); - -/*! - * \brief update PFB dependency (event handlers) - * \param[in] ptThis the PFB control block - * \param[in] chMask the bit mask for event handlers - * \param[in] ptDependency the new dependency description - * \return arm_2d_err_t the process result - */ -extern -ARM_NONNULL(1,3) -arm_2d_err_t arm_2d_helper_pfb_update_dependency( - arm_2d_helper_pfb_t *ptThis, - uint_fast8_t chMask, - const arm_2d_helper_pfb_dependency_t *ptDependency); - -/*! - * \brief tell PFB helper that a low level LCD flushing work is complete - * \note This function is THREAD-SAFE, You can call this function asynchronously, - * e.g. - * - A ISR to indicate DMA-transfer complete event or - * - A different Thread - * \param[in] ptThis the PFB control block - * \param[in] ptPFB the used PFB block - */ -extern -ARM_NONNULL(1,2) -void arm_2d_helper_pfb_report_rendering_complete( arm_2d_helper_pfb_t *ptThis, - arm_2d_pfb_t *ptPFB); - -/*! - * \brief swap the high and low bytes for each rgb16 pixel - * - * \params[in] phwBuffer the pixel buffer - * \note the phwBuffer MUST aligned to half-word addresses - * - * \params[in] wSize the number of pixels - */ -extern -void arm_2d_helper_swap_rgb16(uint16_t *phwBuffer, uint32_t wCount); - -/*! - * \brief convert ticks of a reference timer to millisecond - * - * \param[in] lTick the tick count - * \return int64_t the millisecond - */ -extern -int64_t arm_2d_helper_convert_ticks_to_ms(int64_t lTick); - -/*! - * \brief convert millisecond into ticks of the reference timer - * - * \param[in] wMS the target time in millisecond - * \return int64_t the ticks - */ -extern -int64_t arm_2d_helper_convert_ms_to_ticks(uint32_t wMS); - -/*! - * \brief get the reference clock frequency - * \return uint32_t the frequency - */ -extern -uint32_t arm_2d_helper_get_reference_clock_frequency(void); - -/*! - * \brief get the current system stamp from the reference clock - * - * \return int64_t the timestamp in ticks (no overflow issue) - * \note you have to call arm_2d_helper_convert_ticks_to_ms() to convert the - * the timestamp into milliseconds when required. - */ -extern -int64_t arm_2d_helper_get_system_timestamp(void); - -/*! - * \brief try to get a PFB block from the pool - * \param[in] ptThis the PFB control block - * \retval NULL the pool is empty - * \retval !NULL a valid pfb block - */ -extern -ARM_NONNULL(1) -arm_2d_pfb_t *__arm_2d_helper_pfb_new(arm_2d_helper_pfb_t *ptThis); - -/*! - * \brief free a PFB block to the pool - * \param[in] ptThis the PFB control block - * \param[in] ptPFB the target PFB block - */ -extern -ARM_NONNULL(1) -void __arm_2d_helper_pfb_free(arm_2d_helper_pfb_t *ptThis, arm_2d_pfb_t *ptPFB); - -/*! @} */ - -#if defined(__clang__) -# pragma clang diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - - - -#endif diff --git a/package/Arm2D/Helper/Include/arm_2d_helper_scene.h b/package/Arm2D/Helper/Include/arm_2d_helper_scene.h deleted file mode 100644 index d9381c876..000000000 --- a/package/Arm2D/Helper/Include/arm_2d_helper_scene.h +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d_helper_scene.h" - * Description: Public header file for the scene service - * - * $Date: 29. Aug 2022 - * $Revision: V.1.3.4 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_HELPER_SCENE_H__ -#define __ARM_2D_HELPER_SCENE_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d_helper_pfb.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -# pragma clang diagnostic ignored "-Wpadded" -#endif - -/*! - * \addtogroup gHelper 7 Helper Services - * @{ - */ - - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ - -/*! - * \brief scene switching mode - */ -typedef enum { - - /* valid switching visual effects begin */ - ARM_2D_SCENE_SWITCH_MODE_NONE = 0, //!< no switching visual effect - ARM_2D_SCENE_SWITCH_MODE_USER = 1, //!< user defined switching visual effect - ARM_2D_SCENE_SWITCH_MODE_FADE_WHITE = 2, //!< fade in fade out (white) - ARM_2D_SCENE_SWITCH_MODE_FADE_BLACK = 3, //!< fade in fade out (black) - ARM_2D_SCENE_SWITCH_MODE_SLIDE_LEFT = 4, //!< slide left - ARM_2D_SCENE_SWITCH_MODE_SLIDE_RIGHT, //!< slide right - ARM_2D_SCENE_SWITCH_MODE_SLIDE_UP, //!< slide up - ARM_2D_SCENE_SWITCH_MODE_SLIDE_DOWN, //!< slide down - ARM_2D_SCENE_SWITCH_MODE_ERASE_LEFT = 8, //!< erase to the right - ARM_2D_SCENE_SWITCH_MODE_ERASE_RIGHT, //!< erase to the left - ARM_2D_SCENE_SWITCH_MODE_ERASE_UP, //!< erase to the top - ARM_2D_SCENE_SWITCH_MODE_ERASE_DOWN, //!< erase to the bottom - - /* valid switching visual effects end */ - __ARM_2D_SCENE_SWITCH_MODE_VALID, //!< For internal user only - - - - ARM_2D_SCENE_SWITCH_MODE_IGNORE_OLD_BG = _BV(8), //!< ignore the background of the old scene - ARM_2D_SCENE_SWITCH_MODE_IGNORE_OLD_SCEBE = _BV(9), //!< ignore the old scene - ARM_2D_SCENE_SWITCH_MODE_IGNORE_NEW_BG = _BV(10), //!< ignore the background of the new scene - ARM_2D_SCENE_SWITCH_MODE_IGNORE_NEW_SCEBE = _BV(11), //!< ignore the new scene - - ARM_2D_SCENE_SWITCH_MODE_DEFAULT_BG_WHITE = 0 << 12, //!< use white as default background - ARM_2D_SCENE_SWITCH_MODE_DEFAULT_BG_BLACK = 1 << 12, //!< use black as default background - ARM_2D_SCENE_SWITCH_MODE_DEFAULT_BG_USER = 2 << 12, //!< use user defined default background - - __ARM_2D_SCENE_SWTICH_MODE_IGNORE_msk = 0x0F << 8, //!< For internal user only - __ARM_2D_SCENE_SWTICH_MODE_IGNORE_pos = 8, //!< For internal user only - __ARM_2D_SCENE_SWTICH_MODE_DEFAULT_BG_msk = 3 << 12, //!< For internal user only - __ARM_2D_SCENE_SWTICH_MODE_DEFAULT_BG_pos = 12, //!< For internal user only - -} arm_2d_scene_player_switch_mode_t; - -typedef union __arm_2d_helper_scene_switch_t { - struct { - uint8_t chMode; //!< the switch visual effect - uint8_t bIgnoreOldSceneBG : 1; //!< when set, ignore the background of the old scene - uint8_t bIgnoreOldScene : 1; //!< when set, ignore the old scene - uint8_t bIgnoreNewSceneBG : 1; //!< when set, ignore the background of the new scene - uint8_t bIgnoreNewScene : 1; //!< when set, ignore the new scene - uint8_t u2DefaultBG : 2; //!< the default background - uint8_t : 2; - } Feature; - uint16_t hwSetting; //!< the setting value -}__arm_2d_helper_scene_switch_t; - - - -typedef struct arm_2d_scene_player_t arm_2d_scene_player_t; - -/*! - * \brief a class for describing scenes which are the combination of a - * background and a foreground with a dirty-region-list support - * - */ -typedef struct arm_2d_scene_t arm_2d_scene_t; -struct arm_2d_scene_t { - arm_2d_scene_t *ptNext; //!< next scene - arm_2d_scene_player_t *ptPlayer; //!< points to the host scene player - arm_2d_region_list_item_t *ptDirtyRegion; //!< dirty region list for the foreground - arm_2d_helper_draw_handler_t *fnBackground; //!< the function pointer for the background - arm_2d_helper_draw_handler_t *fnScene; //!< the function pointer for the foreground - void (*fnOnBGStart)(arm_2d_scene_t *ptThis); //!< on-start-drawing-background event handler - void (*fnOnBGComplete)(arm_2d_scene_t *ptThis); //!< on-complete-drawing-background event handler - void (*fnOnFrameStart)(arm_2d_scene_t *ptThis); //!< on-frame-start event handler - void (*fnOnFrameCPL)(arm_2d_scene_t *ptThis); //!< on-frame-complete event handler - - /*! - * \note We use fnDepose to free the resources - */ - void (*fnDepose)(arm_2d_scene_t *ptThis); //!< on-scene-depose event handler - struct { - uint8_t bOnSwitchingIgnoreBG : 1; //!< ignore background during switching period - uint8_t bOnSwitchingIgnoreScene : 1; //!< ignore forground during switching period - }; -}; - -/*! - * \brief a class to manage scenes - * - */ -struct arm_2d_scene_player_t { - inherit(arm_2d_helper_pfb_t); //!< inherit from arm_2d_helper_pfb_t - - ARM_PRIVATE( - struct { - arm_2d_scene_t *ptHead; //!< points to the head of the FIFO - arm_2d_scene_t *ptTail; //!< points to the tail of the FIFO - } SceneFIFO; //!< Scene FIFO - - struct { - uint8_t bNextSceneReq : 1; //!< a flag to request switching-to-the next-scene - uint8_t bSwitchCPL : 1; //!< indication of scene switching completion - uint8_t : 6; - uint8_t chState; //!< the state of the FSM used by runtime. - } Runtime; //!< scene player runtime - - struct { - union { - uint8_t chState; - struct { - uint8_t chState; - uint8_t chOpacity; - bool bIsFadeBlack; - }Fade; - struct { - uint8_t chState; - arm_2d_tile_t tSceneWindow; - arm_2d_tile_t tTemp; - int16_t iOffset; - }Erase; - struct { - uint8_t chState; - arm_2d_tile_t tSceneWindow; - int16_t iOffset; - }Slide; - }; - __arm_2d_helper_scene_switch_t tConfig; //!< the switching configuration - uint16_t hwPeriod; //!< the switching should finish in specified millisecond - int64_t lTimeStamp; - }Switch; - ) -}; - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*! - * \brief flush the scene FIFO - * - * \param[in] ptThis the target scene player - */ -extern -ARM_NONNULL(1) -void arm_2d_scene_player_flush_fifo(arm_2d_scene_player_t *ptThis); - -/*! - * \brief append a set of scenes to a scene player - * - * \param[in] ptThis the target scene player - * \param[in] ptScenes a scene array - * \param[in] hwCount the number of scenes in the array - */ -extern -ARM_NONNULL(1) -void arm_2d_scene_player_append_scenes(arm_2d_scene_player_t *ptThis, - arm_2d_scene_t *ptScenes, - int_fast16_t hwCount); - -/*! - * \brief request switching to the next scene safely - * - * \param[in] ptThis the target scene player - * - * \note Once received a request, the scene player will only switch to the - * next scene at the end of a frame. - */ -extern -ARM_NONNULL(1) -void arm_2d_scene_player_switch_to_next_scene(arm_2d_scene_player_t *ptThis); - -/*! - * \brief configure the scene switching mode - * - * \param[in] ptThis the target scene player - * \param[in] hwSettings a combination of valid settings defined in - * arm_2d_scene_player_switch_mode_t - */ -extern -ARM_NONNULL(1) -void arm_2d_scene_player_set_switching_mode(arm_2d_scene_player_t *ptThis, - uint_fast16_t hwSettings); - -/*! - * \brief read the current scene switching mode - * - * \param[in] ptThis the target scene player - * \return uint16_t the current setting value for the scene switching mode - */ -extern -ARM_NONNULL(1) -uint16_t arm_2d_scene_player_get_switching_mode(arm_2d_scene_player_t *ptThis); - -/*! - * \brief configure the scene switching period - * - * \param[in] ptThis the target scene player - * \param[in] hwMS period in millisecond - */ -extern -ARM_NONNULL(1) -void arm_2d_scene_player_set_switching_period( arm_2d_scene_player_t *ptThis, - uint_fast16_t hwMS); - -/*! - * \brief the scene player task function - * - * \param[in] ptThis the target scene player - * - * \note the event sequence of a scene: - * 1. when fnBackground is valid - * - invoke fnOnBGStart when it is valid - * - invoke fnBackground - * - invoke fnOnBGComplete when it is valid - * 2. invoke fnOnFrameStart when it is valid - * 3. invoke fnScene - * 4. invoke fnOnFrameCPL when it is valid - * 5. Check bNextSceneReq - * - false (0), go back to step 2 - * - true, invoke fnDepose when it is valid and switch to the next scene - * - */ -extern -ARM_NONNULL(1) -arm_fsm_rt_t arm_2d_scene_player_task(arm_2d_scene_player_t *ptThis); - -/*! @} */ - -#if defined(__clang__) -# pragma clang diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Helper/Source/arm_2d_helper_pfb.c b/package/Arm2D/Helper/Source/arm_2d_helper_pfb.c deleted file mode 100644 index 92134985b..000000000 --- a/package/Arm2D/Helper/Source/arm_2d_helper_pfb.c +++ /dev/null @@ -1,757 +0,0 @@ -/* - * Copyright (c) 2009-2020 Arm Limited. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d_helper_pfb.c" - * Description: the pfb helper service source code - * - * $Date: 29. Aug 2022 - * $Revision: V.1.2.0 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -/*============================ INCLUDES ======================================*/ -#define __ARM_2D_IMPL__ - -#include -#include -#include -#include "arm_2d_helper.h" - -#if defined(__PERF_COUNTER__) -# include "perf_counter.h" -#else -# include -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wimplicit-fallthrough" -# pragma clang diagnostic ignored "-Wundef" -# pragma clang diagnostic ignored "-Wgnu-statement-expression" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wconditional-uninitialized" -#elif defined(__IS_COMPILER_GCC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -/*============================ MACROS ========================================*/ - -#undef this -#define this (*ptThis) - -/*----------------------------------------------------------------------------* - * PT Operations * - *----------------------------------------------------------------------------*/ -/* -Protothreads open source BSD-style license -The protothreads library is released under an open source license that allows -both commercial and non-commercial use without restrictions. The only -requirement is that credits is given in the source code and in the documentation -for your product. - -The full license text follows. - -Copyright (c) 2004-2005, Swedish Institute of Computer Science. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -3. Neither the name of the Institute nor the names of its contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS `AS IS' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -Author: Adam Dunkels -*/ - -#define ARM_PT_BEGIN(__STATE) \ - enum { \ - count_offset = __COUNTER__ + 1, \ - }; \ - switch (__STATE) { \ - case __COUNTER__ - count_offset: - -#define ARM_PT_ENTRY(__STATE, ...) \ - (__STATE) = (__COUNTER__ - count_offset + 1) >> 1; \ - __VA_ARGS__ \ - case (__COUNTER__ - count_offset) >> 1: (__STATE) = (__STATE); - -#define ARM_PT_YIELD(__STATE) \ - ARM_PT_ENTRY(__STATE, return arm_fsm_rt_on_going;) - -#define ARM_PT_END(__STATE) \ - __STATE = 0; \ - break;} - -#define ARM_PT_GOTO_PREV_ENTRY() return arm_fsm_rt_on_going; - - -#define ARM_PT_REPORT_STATUS(__STATE, __VAL) \ - ARM_PT_ENTRY(__STATE, \ - return (arm_fsm_rt_t)(__VAL); \ - ) - -#define ARM_PT_RETURN(__STATE, __VAL) \ - __STATE = 0; \ - return (arm_fsm_rt_t)(__VAL); - -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ PROTOTYPES ====================================*/ -/*============================ IMPLEMENTATION ================================*/ - -ARM_NONNULL(1) -arm_2d_pfb_t *__arm_2d_helper_pfb_new(arm_2d_helper_pfb_t *ptThis) -{ - assert(NULL != ptThis); - - arm_2d_pfb_t *ptPFB = NULL; - arm_irq_safe { - this.Adapter.hwFreePFBCount--; - ARM_LIST_STACK_POP(this.Adapter.ptFreeList, ptPFB); - } - - ptPFB->ptPFBHelper = ptThis; - - return ptPFB; -} - -ARM_NONNULL(1) -void __arm_2d_helper_pfb_free(arm_2d_helper_pfb_t *ptThis, arm_2d_pfb_t *ptPFB) -{ - assert(NULL != ptThis); - - if (NULL == ptPFB) { - return ; - } - - arm_irq_safe { - ARM_LIST_STACK_PUSH(this.Adapter.ptFreeList, ptPFB); - this.Adapter.hwFreePFBCount++; - } -} - -ARM_NONNULL(1,2) -arm_2d_err_t arm_2d_helper_pfb_init(arm_2d_helper_pfb_t *ptThis, - arm_2d_helper_pfb_cfg_t *ptCFG) -{ - assert(NULL != ptThis); - assert(NULL != ptCFG); - - memset(ptThis, 0, sizeof(this)); - this.tCFG = *ptCFG; - - if (NULL == this.tCFG.Dependency.evtOnLowLevelRendering.fnHandler) { - return ARM_2D_ERR_MISSING_PARAM; - } - - // perform validation - do { - int_fast16_t n = this.tCFG.FrameBuffer.hwPFBNum; - arm_2d_pfb_t *ptItem = this.tCFG.FrameBuffer.ptPFBs; - uint32_t wBufferSize = this.tCFG.FrameBuffer.wBufferSize; - - // handle alignments - wBufferSize += __alignof__(arm_2d_pfb_t) - 1; - wBufferSize &= ~(__alignof__(arm_2d_pfb_t) - 1); - - if (0 == n || NULL == ptItem) { - return ARM_2D_ERR_MISSING_PARAM; - } else if ( (0 == this.tCFG.FrameBuffer.tFrameSize.iHeight) - || (0 == this.tCFG.FrameBuffer.tFrameSize.iWidth) - || (0 == this.tCFG.FrameBuffer.wBufferSize)) { - return ARM_2D_ERR_INVALID_PARAM; - } - - this.Adapter.hwFreePFBCount = 0; - // add PFBs to pool - do { - ptItem->tTile = (arm_2d_tile_t) { - .tRegion = { - .tSize = this.tCFG.FrameBuffer.tFrameSize, - }, - .tInfo.bIsRoot = true, - .pchBuffer = (uint8_t *)((uintptr_t)ptItem + sizeof(arm_2d_pfb_t)), - }; - - // update buffer size - ptItem->u24Size = wBufferSize; - //ARM_LIST_STACK_PUSH(this.Adapter.ptFreeList, ptItem); - __arm_2d_helper_pfb_free(ptThis, ptItem); - - // update pointer - ptItem = (arm_2d_pfb_t *)( (uintptr_t)ptItem - + wBufferSize - + sizeof(arm_2d_pfb_t)); - } while(--n); - - } while(0); - - this.Adapter.bFirstIteration = true; - this.Adapter.bIsFlushRequested = true; - - return ARM_2D_ERR_NONE; -} - -ARM_NONNULL(1) -arm_2d_region_t arm_2d_helper_pfb_get_display_area(arm_2d_helper_pfb_t *ptThis) -{ - assert(NULL != ptThis); - - return this.tCFG.tDisplayArea; -} - -__WEAK -void arm_2d_helper_swap_rgb16(uint16_t *phwBuffer, uint32_t wCount) -{ - if (0 == wCount) { - return ; - } - - // aligned (2) - assert((((uintptr_t) phwBuffer) & 0x01) == 0); - - // it is not aligned to 4 - if ((((uintptr_t) phwBuffer) & 0x03) == 0x02) { - // handle the leading pixel - uint32_t wTemp = *phwBuffer; - *phwBuffer++ = (uint16_t)__REV16(wTemp); - wCount--; - } - - - uint32_t wWords = wCount >> 1; - uint32_t *pwBuffer = (uint32_t *)phwBuffer; - wCount &= 0x01; - - if (wWords > 0) { - do { - uint32_t wTemp = *pwBuffer; - *pwBuffer++ = __REV16(wTemp); - } while(--wWords); - } - - if (wCount) { - uint32_t wTemp = *pwBuffer; - (*(uint16_t *)pwBuffer) = (uint16_t)__REV16(wTemp); - } -} - -ARM_NONNULL(1) -void arm_2d_helper_pfb_flush(arm_2d_helper_pfb_t *ptThis) -{ - assert(NULL != ptThis); - - arm_2d_pfb_t *ptPFB = NULL; - - arm_irq_safe { - ARM_LIST_QUEUE_DEQUEUE( this.Adapter.FlushFIFO.ptHead, - this.Adapter.FlushFIFO.ptTail, - ptPFB); - this.Adapter.bIsFlushRequested = (NULL == ptPFB); - } - - if (NULL != ptPFB) { - ptPFB->ptPFBHelper = ptThis; - - // call handler - (*this.tCFG.Dependency.evtOnLowLevelRendering.fnHandler)( - this.tCFG.Dependency.evtOnLowLevelRendering.pTarget, - ptPFB, - ptPFB->bIsNewFrame); - } -} - -static -void __arm_2d_helper_enqueue_pfb(arm_2d_helper_pfb_t *ptThis) -{ - this.Adapter.ptCurrent->bIsNewFrame = this.Adapter.bFirstIteration; - bool bIsFlushRequested; - - arm_irq_safe { - bIsFlushRequested = this.Adapter.bIsFlushRequested; - ARM_LIST_QUEUE_ENQUEUE( this.Adapter.FlushFIFO.ptHead, - this.Adapter.FlushFIFO.ptTail, - this.Adapter.ptCurrent); - } - - if (bIsFlushRequested) { - arm_2d_helper_pfb_flush(ptThis); - } - -} - - -static -void __arm_2d_helper_low_level_rendering(arm_2d_helper_pfb_t *ptThis) -{ - - assert(NULL != this.tCFG.Dependency.evtOnLowLevelRendering.fnHandler); - assert(NULL != this.Adapter.ptCurrent); - - // update location info - this.Adapter.ptCurrent->tTile.tRegion.tLocation = (arm_2d_location_t) { - .iX = this.Adapter.tDrawRegion.tLocation.iX - + this.Adapter.tTargetRegion.tLocation.iX, - .iY = this.Adapter.tDrawRegion.tLocation.iY - + this.Adapter.tTargetRegion.tLocation.iY, - }; - - if (this.tCFG.FrameBuffer.bSwapRGB16) { - arm_2d_helper_swap_rgb16( this.Adapter.ptCurrent->tTile.phwBuffer, - get_tile_buffer_pixel_count( - this.Adapter.ptCurrent->tTile)); - } - - __arm_2d_helper_enqueue_pfb(ptThis); - - this.Adapter.bFirstIteration = false; - -} - - -static bool __arm_2d_helper_pfb_get_next_dirty_region(arm_2d_helper_pfb_t *ptThis) -{ - if (NULL == this.Adapter.ptDirtyRegion) { - // no dirty region list - this.Adapter.bFirstIteration = true; - - return false; - } - - this.Adapter.ptDirtyRegion = this.Adapter.ptDirtyRegion->ptNext; - - if (NULL == this.Adapter.ptDirtyRegion) { - // reach last item in a chain - this.Adapter.bFirstIteration = true; - - return false; - } else { - this.Adapter.bIsRegionChanged = true; - } - - return true; -} - - -/*! \brief begin a iteration of drawing and request a frame buffer from - * low level display driver. - * \param[in] ptThis the PFB helper control block - * \param[in] ptTargetRegion the address of the target region in the LCD - * passing NULL means we want to draw the whole LCD. - * \retval NULL the display driver is not ready - * \retval (intptr_t)-1 the display driver want to ignore this drawing - * (maybe because the target area is out of the LCD) - * \retval non-null a tile which contains the (partial) frame buffer - */ -static -arm_2d_tile_t * __arm_2d_helper_pfb_drawing_iteration_begin( - arm_2d_helper_pfb_t *ptThis, - arm_2d_region_list_item_t *ptDirtyRegions) -{ -// arm_irq_safe { -// ARM_LIST_STACK_POP(this.Adapter.ptFreeList, this.Adapter.ptCurrent); -// } - this.Adapter.ptCurrent = NULL; - arm_irq_safe { - /* allocating pfb only when the number of free PFB blocks is larger than - * the reserved threashold - */ - if (this.Adapter.hwFreePFBCount > this.tCFG.FrameBuffer.u4PoolReserve) { - this.Adapter.ptCurrent = __arm_2d_helper_pfb_new(ptThis); - } - } - - if (NULL == this.Adapter.ptCurrent) { - // no resource left - return NULL; - } - arm_2d_tile_t *ptPartialFrameBuffer = &(this.Adapter.ptCurrent->tTile); - - if (this.Adapter.bFirstIteration) { - this.Adapter.ptDirtyRegion = ptDirtyRegions; - //this.Adapter.bFirstIteration = false; - this.Adapter.bIsRegionChanged = true; - } - - do { - if (this.Adapter.bIsRegionChanged) { - - this.Adapter.bIsRegionChanged = false; - - if (NULL != this.Adapter.ptDirtyRegion) { - // calculate the valid region - if (!arm_2d_region_intersect( &this.tCFG.tDisplayArea, - &(this.Adapter.ptDirtyRegion->tRegion), - &this.Adapter.tTargetRegion)) { - - if (__arm_2d_helper_pfb_get_next_dirty_region(ptThis)) { - // try next region - continue; - } - // out of lcd - return (arm_2d_tile_t *)-1; - } - } else { - this.Adapter.tTargetRegion = this.tCFG.tDisplayArea; - } - - #if __ARM_ARCH == 6 || __TARGET_ARCH_THUMB == 3 - // reset adapter frame size - this.Adapter.tFrameSize = this.tCFG.FrameBuffer.tFrameSize; - #else - if (this.tCFG.FrameBuffer.bDisableDynamicFPBSize) { - // reset adapter frame size - this.Adapter.tFrameSize = this.tCFG.FrameBuffer.tFrameSize; - - } else { //!< update PFB size - uint32_t wTargetPixelCount - = this.Adapter.tTargetRegion.tSize.iWidth - * this.Adapter.tTargetRegion.tSize.iHeight; - - uint32_t wPFBPixelCount - = this.tCFG.FrameBuffer.tFrameSize.iWidth - * this.tCFG.FrameBuffer.tFrameSize.iHeight; - - if ( (wTargetPixelCount <= wPFBPixelCount) - || ( this.Adapter.tTargetRegion.tSize.iWidth - < this.tCFG.FrameBuffer.tFrameSize.iWidth)) { - // redefine the shape of PFB - - this.Adapter.tFrameSize.iWidth - = this.Adapter.tTargetRegion.tSize.iWidth; - - this.Adapter.tFrameSize.iHeight = (int16_t)( - wPFBPixelCount - / (uint32_t)this.Adapter.tTargetRegion.tSize.iWidth); - - } else { - // reset adapter frame size - this.Adapter.tFrameSize = this.tCFG.FrameBuffer.tFrameSize; - } - } - #endif - } - break; - } while(true); - - - arm_2d_region_t tTempRegion = { - .tSize = this.tCFG.tDisplayArea.tSize, - .tLocation = { - .iX = - ( this.Adapter.tTargetRegion.tLocation.iX - + this.Adapter.tDrawRegion.tLocation.iX), - .iY = - ( this.Adapter.tTargetRegion.tLocation.iY - + this.Adapter.tDrawRegion.tLocation.iY), - }, - }; - - - ptPartialFrameBuffer->tRegion.tSize.iWidth - = MIN( this.Adapter.tFrameSize.iWidth, - this.Adapter.tTargetRegion.tSize.iWidth - - this.Adapter.tDrawRegion.tLocation.iX); - ptPartialFrameBuffer->tRegion.tSize.iHeight - = MIN( this.Adapter.tFrameSize.iHeight, - this.Adapter.tTargetRegion.tSize.iHeight - - this.Adapter.tDrawRegion.tLocation.iY); - - arm_2d_tile_generate_child( ptPartialFrameBuffer, - &tTempRegion, - &this.Adapter.tPFBTile, - false); - - - if (!this.tCFG.FrameBuffer.bDoNOTUpdateDefaultFrameBuffer) { - // update default frame buffer - arm_2d_set_default_frame_buffer(&this.Adapter.tPFBTile); - } - - // uncomment this when necessary for debug purpose - //arm_2d_rgb16_fill_colour(&this.Adapter.tPFBTile, NULL, 0); - - return (arm_2d_tile_t *)&(this.Adapter.tPFBTile); -} - - - -/*! \brief end a drawing iteration and decide wether a new iteration is required - * or not based on the return value - * \param[in] ptThis the PFB control block - * \retval true a new iteration is required - * \retval false no more iteration is required - */ -static -bool __arm_2d_helper_pfb_drawing_iteration_end(arm_2d_helper_pfb_t *ptThis) -{ - __arm_2d_helper_low_level_rendering(ptThis); - - arm_2d_tile_t *ptPartialFrameBuffer = &(this.Adapter.ptCurrent->tTile); - - if (!this.tCFG.FrameBuffer.bDoNOTUpdateDefaultFrameBuffer) { - // update default frame buffer - arm_2d_set_default_frame_buffer(NULL); - } - - this.Adapter.tDrawRegion.tLocation.iX - += ptPartialFrameBuffer->tRegion.tSize.iWidth; - if ( this.Adapter.tDrawRegion.tLocation.iX - >= this.Adapter.tTargetRegion.tSize.iWidth) { - this.Adapter.tDrawRegion.tLocation.iY - += ptPartialFrameBuffer->tRegion.tSize.iHeight; - this.Adapter.tDrawRegion.tLocation.iX = 0; - - if ( this.Adapter.tDrawRegion.tLocation.iY - >= this.Adapter.tTargetRegion.tSize.iHeight) { - // finished - this.Adapter.tDrawRegion.tLocation.iY = 0; - - return __arm_2d_helper_pfb_get_next_dirty_region(ptThis); - - } - } - - return true; -} - - -__WEAK int64_t arm_2d_helper_get_system_timestamp(void) -{ -#if defined(__PERF_COUNTER__) - return get_system_ticks(); -#else - return (int64_t)clock(); -#endif -} - -__WEAK -uint32_t arm_2d_helper_get_reference_clock_frequency(void) -{ - extern uint32_t SystemCoreClock; - return SystemCoreClock; -} - - -int64_t arm_2d_helper_convert_ticks_to_ms(int64_t lTick) -{ - return (lTick * 1000) / (int64_t)arm_2d_helper_get_reference_clock_frequency(); -} - -int64_t arm_2d_helper_convert_ms_to_ticks(uint32_t wMS) -{ - int64_t lResult = arm_2d_helper_get_reference_clock_frequency() - * (int64_t)wMS / 1000ul; - return lResult ? lResult : 1; -} - - - -__WEAK void __arm_2d_helper_perf_counter_start(int64_t *plTimestamp) -{ - assert(NULL != plTimestamp); - *plTimestamp = arm_2d_helper_get_system_timestamp(); -} - -__WEAK int32_t __arm_2d_helper_perf_counter_stop(int64_t *plTimestamp) -{ - assert(NULL != plTimestamp); - return (int32_t)( (int64_t)arm_2d_helper_get_system_timestamp() - - (int64_t)*plTimestamp); -} - - -ARM_NONNULL(1,2) -void arm_2d_helper_pfb_report_rendering_complete(arm_2d_helper_pfb_t *ptThis, - arm_2d_pfb_t *ptPFB) -{ - assert(NULL != ptThis); - assert(NULL != ptPFB); - - ptPFB->tTile.tRegion.tLocation = (arm_2d_location_t) {0,0}; - -// arm_irq_safe { -// ARM_LIST_STACK_PUSH(this.Adapter.ptFreeList, ptPFB); -// } - __arm_2d_helper_pfb_free(ptThis, ptPFB); - - arm_2d_helper_pfb_flush(ptThis); -} - - -ARM_NONNULL(1,3) -arm_2d_err_t arm_2d_helper_pfb_update_dependency( - arm_2d_helper_pfb_t *ptThis, - uint_fast8_t chMask, - const arm_2d_helper_pfb_dependency_t *ptDependency) -{ - assert(NULL != ptThis); - assert(NULL != ptDependency); - - arm_irq_safe { - if (chMask & ARM_2D_PFB_DEPEND_ON_LOW_LEVEL_RENDERING) { - this.tCFG.Dependency.evtOnLowLevelRendering - = ptDependency->evtOnLowLevelRendering; - } - - if (chMask & ARM_2D_PFB_DEPEND_ON_DRAWING) { - this.tCFG.Dependency.evtOnDrawing - = ptDependency->evtOnDrawing; - } - - if (chMask & ARM_2D_PFB_DEPEND_ON_LOW_LEVEL_SYNC_UP) { - this.tCFG.Dependency.evtOnLowLevelSyncUp - = ptDependency->evtOnLowLevelSyncUp; - } - } - - return ARM_2D_ERR_NONE; -} - - -arm_fsm_rt_t arm_2d_helper_pfb_task(arm_2d_helper_pfb_t *ptThis, - arm_2d_region_list_item_t *ptDirtyRegions) -{ - assert(NULL != ptThis); - assert(NULL != this.tCFG.Dependency.evtOnDrawing.fnHandler); - arm_fsm_rt_t tResult; - -ARM_PT_BEGIN(this.Adapter.chPT) - - this.Statistics.nTotalCycle = 0; - this.Statistics.nRenderingCycle = 0; - this.Adapter.bIsNewFrame = true; - __arm_2d_helper_perf_counter_start(&this.Statistics.lTimestamp); - do { - this.Statistics.nRenderingCycle += __arm_2d_helper_perf_counter_stop(&this.Statistics.lTimestamp); - - /* begin of the drawing iteration, - * try to request the tile of frame buffer - */ - - do { - - /*! \note In deep embedded applications, a LCD usually is connected - * via a serial interface to save pins, hence the bandwidth - * is limited and the FPS is low due to the bandwidth. - * To overcome this issue, some partial-flushing schemes are - * used, such as: - * - Dirty Region based partial-flushing - * - Flush the known and fixed small area that is updated - * frequently based on the application scenarios. - * - * It is worth emphasizing that as we are using partial - * flushing scheme, which means for a given frame, we only - * update those changed area(s) but not the complete frame, - * using the term frame per sec (FPS) might confuse people, - * hence, we decide to introduce a NEW term called update per - * sec (UPS) to avoid this confusion. It reflects what people - * feel when looking at the LCD but not necessarily means - * the rate that a complete frame is flushed into LCD. - * - * In Arm-2D: - * - FPS is a sub-set of UPS. - * - UPS forcus on how people feel and FPS is sticks to the - * concept of (full) frame per sec. - */ - - // request to draw the whole LCD - this.Adapter.ptFrameBuffer = - __arm_2d_helper_pfb_drawing_iteration_begin( - ptThis, - ptDirtyRegions); - if (NULL == this.Adapter.ptFrameBuffer) { - if (NULL != this.tCFG.Dependency.evtOnLowLevelSyncUp.fnHandler){ - // wait until lcd is ready - (*this.tCFG.Dependency.evtOnLowLevelSyncUp.fnHandler)( - this.tCFG.Dependency.evtOnLowLevelSyncUp.pTarget - ); - } - continue; - } else if (-1 == (intptr_t)this.Adapter.ptFrameBuffer) { - /* display driver wants to end the drawing */ - return arm_fsm_rt_cpl; - } - } while(NULL == this.Adapter.ptFrameBuffer); - - ARM_PT_ENTRY(this.Adapter.chPT) - - __arm_2d_helper_perf_counter_start(&this.Statistics.lTimestamp); - // draw all the gui elements on target frame buffer - tResult = this.tCFG.Dependency.evtOnDrawing.fnHandler( - this.tCFG.Dependency.evtOnDrawing.pTarget, - this.Adapter.ptFrameBuffer, - this.Adapter.bIsNewFrame); - // just in case some one forgot to do this... - arm_2d_op_wait_async(NULL); - - this.Adapter.bIsNewFrame = false; - this.Statistics.nTotalCycle += __arm_2d_helper_perf_counter_stop(&this.Statistics.lTimestamp); - - if (arm_fsm_rt_on_going == tResult) { - ARM_PT_GOTO_PREV_ENTRY() - } else if (tResult < 0) { - // error was reported - ARM_PT_RETURN(this.Adapter.chPT, tResult) - } else if (arm_fsm_rt_wait_for_obj == tResult) { - ARM_PT_REPORT_STATUS(this.Adapter.chPT, tResult) - } else { - ARM_PT_YIELD(this.Adapter.chPT) - } - - __arm_2d_helper_perf_counter_start(&this.Statistics.lTimestamp); - } while(__arm_2d_helper_pfb_drawing_iteration_end(ptThis)); - - this.Statistics.nRenderingCycle += __arm_2d_helper_perf_counter_stop(&this.Statistics.lTimestamp); -ARM_PT_END(this.Adapter.chPT) - - return arm_fsm_rt_cpl; -} - - diff --git a/package/Arm2D/LICENSE b/package/Arm2D/LICENSE deleted file mode 100644 index 58aaf9511..000000000 --- a/package/Arm2D/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 signalProcessing - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/package/Arm2D/Library/Include/README.md b/package/Arm2D/Library/Include/README.md deleted file mode 100644 index 8f5d9211f..000000000 --- a/package/Arm2D/Library/Include/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Header Files Summary {#headers} - -## 1 Overview - -As an open-source project, arm-2d serves users with different purposes and background. In general, arm-2d is designed with two groups of users in mind: - -- **Library Users** - who use arm-2d public APIs in their applications -- **Professional Users** - all other users who are - - Integrating arm-2d with GUI stacks - - Accelerating arm-2d with some 2D HW accelerators - - Hobbyists writing new GUIs and/or 2D game engines based on arm-2d. - -For the Library Users, **Public Header Files** provide all the information required to use arm-2d services. For the Professional Users, additional information are provided in **Private Header Files** to help their design. - - - -## 2 Public Header Files - -In the `Library/Include` folder, all header files (*.h) **without** double-underscore-prefix, i.e. "__", are considered as **PUBLIC HEADER FILES**. They are listed in the **Table 2-1**. - -**Table 2-1 Summary of Public Header Files** - -| File Name | Description | Note | -| ----------------------------- | ------------------------------------------------------------ | ---------------------------------------------------- | -| ***arm_2d.h*** | **The main entry for all users.** To use any arm-2d services, you **must** include this header file first. It includes all other public header files list below. | | -| ***arm_2d_types.h*** | This header file provides the definitions for the common and/or important data types, enumerations etc. | | -| ***arm_2d_utils.h*** | This header file provides utilities used in arm-2d, such as macros for compiler-detection, OOPC, C language helpers etc. | | -| ***arm_2d_features.h*** | This header file provides feature detection services for compiler and target processors. It also help to define, detect and validate macro-based-options for switching arm-2d features on and off. | **Do Not Modify** | -| ***arm_2d_op.h*** | This header file list all the arm-2d OPCODE, i.e. ***ARM_2D_OP_xxxx*** | | -| ***arm_2d_tile.h*** | The header file for all basic tile operations, e.g. tile-copy/filling with/without mirroring, with/without colour-keying etc. | [Doc](../../documentation/how_to_use_tile_operations.md) | -| ***arm_2d_draw.h*** | The header file for all drawing related operations, e.g. filling rectangular area, drawing points, drawing bit-patterns etc. | | -| ***arm_2d_conversion.h*** | The header file for colour-format conversion operations, e.g. conversion between RGB565 and RGB888 etc. | | -| ***arm_2d_alpha_blending.h*** | The header file for alpha-blending centric operations, e.g. alpha-blending, copy with masks, colour-keying with opacity etc. | | -| ***arm_2d_transform.h*** | The header file for transform operations, i.e. rotation and/or scaling (zooming). | | - - - -## 3 Private Header Files - -In the `Library/Include` folder, all header files (*.h) **with** double-underscore-prefix, i.e. "__", are considered as **PRIVATE HEADER FILES**. Only professional users should read them. - -**Table 3-1 Summary of Private Header Files** - -| File Name | Description | Note | -| ------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| ***__arm_2d_impl.h*** | **The main entry for all professional users.** For advanced development (not for normal applications), you must include this header file that includes most of the private header files list below. | | -| ***__arm_2d_direct.h*** | This file lists all the low level implementations for specific variants of 2D operations. It is useful when integrating arm-2d with a GUI stack. | This file is included by ***__arm_2d_impl.h***, please do NOT include it directly. | -| ***__arm_2d_math.h*** | This file provides some math related utilities. | | -| ***__arm_2d_math_helium.h*** | This file provides some math related utilities for helium only. It is **NOT** intended to be used outside of arm-2d. | **Do NOT Use.** | -| ***__arm_2d_paving.h*** | This file lists some internal macro templates. It is **NOT** intended to be used outside of arm-2d. | **Do NOT Use.** | -| ***__arm_2d_paving_helium.h*** | This file lists some internal macro templates for helium only. It is **NOT** intended to be used outside of arm-2d. | **Do NOT Use.** | -| ***__arm_2d_utils_helium.h*** | This file lists some internal utils for helium only. It is **NOT** intended to be used outside of arm-2d. | **Do NOT Use.** | - - - -## 4 Templates - -In the `Library/Include/template` folder, there are some header files used as templates for purposes including but not limited to configuration etc. - -**Table 4-1 Summary of Templates** - -| File Name | Description | Note | -| ------------------ | ------------------------------------------------------- | ---- | -| ***arm_2d_cfg.h*** | A configuration template used in the arm-2d cmsis-pack. | | diff --git a/package/Arm2D/Library/Include/__arm_2d_direct.h b/package/Arm2D/Library/Include/__arm_2d_direct.h deleted file mode 100644 index 73dc92aa9..000000000 --- a/package/Arm2D/Library/Include/__arm_2d_direct.h +++ /dev/null @@ -1,9317 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_direct.h - * Description: header files for internal users or professional developers - * - * $Date: 29. April 2022 - * $Revision: V.1.0.2 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_DIRECT_H__ -#define __ARM_2D_DIRECT_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wmissing-declarations" -# pragma clang diagnostic ignored "-Wpadded" -#elif __IS_COMPILER_ARM_COMPILER_5__ -# pragma diag_suppress 174,177,188,68,513,144,64 -#elif __IS_COMPILER_IAR__ -# pragma diag_suppress=Pe301 -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-value" -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - - -void __arm_2d_impl_c8bit_1x1_paving(const uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_c8bit_1x1_paving_x_mirror(const uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_c8bit_1x1_paving_xy_mirror(const uint8_t * - __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_c8bit_1x1_paving_y_mirror(const uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_c8bit_1x2_paving(const uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_c8bit_1x2_paving_x_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_c8bit_1x2_paving_xy_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_c8bit_1x2_paving_y_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_c8bit_2x1_paving(const uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, uint16_t destHeight); - -void __arm_2d_impl_c8bit_2x1_paving_x_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_c8bit_2x1_paving_xy_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_c8bit_2x1_paving_y_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_c8bit_2x2_paving(const uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_c8bit_2x2_paving_x_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_c8bit_2x2_paving_xy_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_c8bit_2x2_paving_y_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_c8bit_cl_key_1x1_paving(const uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_1x1_paving_x_mirror(const uint8_t * - __restrict pSource, - int16_t iSourceStride, - uint8_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_1x1_paving_xy_mirror(const uint8_t * - __restrict pSource, - int16_t iSourceStride, - uint8_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_1x1_paving_y_mirror(const uint8_t * - __restrict pSource, - int16_t iSourceStride, - uint8_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_1x2_paving(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_1x2_paving_x_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_1x2_paving_xy_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_1x2_paving_y_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x1_paving(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x1_paving_x_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x1_paving_xy_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x1_paving_y_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x2_paving(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x2_paving_x_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x2_paving_xy_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_2x2_paving_y_mirror(const uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_copy(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_copy_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode, uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_copy_x_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_copy_xy_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_copy_y_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_fill(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_fill_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode, uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_fill_x_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_fill_xy_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_cl_key_fill_y_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_colour_filling(uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint8_t Colour); - -void __arm_2d_impl_c8bit_copy(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_c8bit_copy_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_c8bit_copy_x_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_c8bit_copy_xy_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_c8bit_copy_y_mirror(uint8_t * __restrict pSource, - int16_t iSourceStride, - uint8_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_c8bit_draw_pattern(uint8_t * __restrict pchSourceBase, - int32_t iOffset, int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint8_t chMode, uint8_t ForeColour, - uint8_t BackColour); - -void __arm_2d_impl_c8bit_draw_pattern_bg_comp(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t BackColour); - -void __arm_2d_impl_c8bit_draw_pattern_bg_fg(uint8_t * __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t ForeColour, - uint8_t BackColour); - -void __arm_2d_impl_c8bit_draw_pattern_bg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t BackColour); - -void __arm_2d_impl_c8bit_draw_pattern_fg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t ForeColour); - -void __arm_2d_impl_c8bit_draw_pattern_no_bg_comp(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_c8bit_fill(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_c8bit_fill_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_c8bit_fill_x_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_c8bit_fill_xy_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_c8bit_fill_y_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_1h_des_msk_copy(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_1h_des_msk_copy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_1h_des_msk_copy_x_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_1h_des_msk_copy_xy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_1h_des_msk_copy_y_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_1h_des_msk_fill(uint32_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_1h_des_msk_fill_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_1h_des_msk_fill_x_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_1h_des_msk_fill_xy_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_1h_des_msk_fill_y_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_alpha_blending(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint_fast16_t chRatio); - -void __arm_2d_impl_cccn888_alpha_blending(uint32_t * pwSourceBase, - int16_t iSourceStride, - uint32_t * pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * ptCopySize, - uint_fast16_t chRatio); - -void __arm_2d_impl_cccn888_alpha_blending_colour_keying(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint_fast16_t chRatio, - uint32_t Colour); - -void __arm_2d_impl_cccn888_colour_filling_channel_mask(uint32_t * - __restrict pTarget, - int16_t iTargetStride, - uint32_t * - __restrict pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t Colour); - -void __arm_2d_impl_cccn888_colour_filling_channel_mask_opacity(uint32_t * - __restrict - pTarget, - int16_t - iTargetStride, - uint32_t * - __restrict - pwAlpha, - int16_t - iAlphaStride, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t Colour, - uint_fast16_t hwOpacity); - -void __arm_2d_impl_cccn888_colour_filling_mask(uint32_t * __restrict pTarget, - int16_t iTargetStride, - uint8_t * __restrict pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t Colour); - -void __arm_2d_impl_cccn888_colour_filling_mask_opacity(uint32_t * - __restrict pTarget, - int16_t iTargetStride, - uint8_t * - __restrict pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t Colour, - uint_fast16_t hwOpacity); - -void __arm_2d_impl_cccn888_colour_filling_with_opacity(uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t Colour, - uint_fast16_t hwRatio); - -void __arm_2d_impl_cccn888_des_chn_msk_copy(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_chn_msk_copy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_des_chn_msk_copy_x_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_chn_msk_copy_xy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_chn_msk_copy_y_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_chn_msk_fill(uint32_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_des_chn_msk_fill_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_des_chn_msk_fill_x_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_des_chn_msk_fill_xy_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_des_chn_msk_fill_y_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_des_msk_copy(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_msk_copy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_des_msk_copy_x_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_msk_copy_xy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_msk_copy_y_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_des_msk_fill(uint32_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint32_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_des_msk_fill_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_des_msk_fill_x_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_des_msk_fill_xy_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_des_msk_fill_y_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_masks_copy(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_cccn888_masks_copy_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_masks_copy_x_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_masks_copy_xy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_masks_copy_y_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_masks_fill(uint32_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_masks_fill_mirror(uint32_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_masks_fill_x_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_masks_fill_xy_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_masks_fill_y_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_copy(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_copy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_copy_x_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_copy_xy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_copy_y_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_fill(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_fill_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_fill_x_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_fill_xy_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_1h_des_msk_fill_y_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_copy(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_copy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_copy_x_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_copy_xy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_copy_y_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_copy(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_copy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_copy_x_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_copy_xy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t - * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t - * - __restrict - ptTargetMaskSize, - arm_2d_size_t - * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_copy_y_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_fill(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_fill_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_fill_x_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_fill_xy_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t - * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t - * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t - * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t - * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_chn_msk_fill_y_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_copy(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_copy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_copy_x_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_copy_xy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_copy_y_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_fill(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_fill_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_fill_x_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_fill_xy_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_des_msk_fill_y_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_chn_msk_fill(uint32_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_src_chn_msk_fill_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_chn_msk_fill_x_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_src_chn_msk_fill_xy_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_src_chn_msk_fill_y_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_copy(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_copy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_copy_x_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_copy_xy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_copy_y_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_fill(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_fill_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_fill_x_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_fill_xy_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_1h_des_msk_fill_y_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_copy(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_copy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_msk_copy_x_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_copy_xy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_copy_y_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_copy(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_copy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_copy_x_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_copy_xy_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_copy_y_mirror(uint32_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_fill(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_fill_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_fill_x_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_fill_xy_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_des_chn_msk_fill_y_mirror(uint32_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint32_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_cccn888_src_msk_fill(uint32_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_src_msk_fill_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_cccn888_src_msk_fill_x_mirror(uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_src_msk_fill_xy_mirror( uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_cccn888_src_msk_fill_y_mirror( uint32_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint32_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_to_rgb565( uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_cccn888_to_rgb565(uint32_t * __restrict pwSourceBase, - int16_t iSourceStride, - uint16_t * __restrict phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_cccn888_transform(__arm_2d_param_copy_orig_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_cccn888_transform_with_opacity( - __arm_2d_param_copy_orig_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_cccn888_transform_with_src_mask( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_cccn888_transform_with_src_mask_and_opacity( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_cccn888_transform_with_src_chn_mask( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_cccn888_transform_with_src_chn_mask_and_opacity( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_gray8_1h_des_msk_copy(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_gray8_1h_des_msk_copy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_1h_des_msk_copy_x_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_1h_des_msk_copy_xy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_1h_des_msk_copy_y_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_1h_des_msk_fill(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_1h_des_msk_fill_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_1h_des_msk_fill_x_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_1h_des_msk_fill_xy_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_1h_des_msk_fill_y_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_alpha_blending(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint_fast16_t hwRatio); - -void __arm_2d_impl_gray8_alpha_blending_colour_keying(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint_fast16_t hwRatio, - uint8_t Colour); - -void __arm_2d_impl_gray8_colour_filling_channel_mask(uint8_t * - __restrict pTarget, - int16_t iTargetStride, - uint32_t * - __restrict pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour); - -void __arm_2d_impl_gray8_colour_filling_channel_mask_opacity(uint8_t * - __restrict pTarget, - int16_t - iTargetStride, - uint32_t * - __restrict pwAlpha, - int16_t - iAlphaStride, - arm_2d_size_t * - __restrict - ptCopySize, - uint8_t Colour, - uint_fast16_t hwOpacity); - -void __arm_2d_impl_gray8_colour_filling_mask(uint8_t * __restrict pTarget, - int16_t iTargetStride, - uint8_t * __restrict pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour); - -void __arm_2d_impl_gray8_colour_filling_mask_opacity(uint8_t * - __restrict pTarget, - int16_t iTargetStride, - uint8_t * - __restrict pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour, - uint_fast16_t hwOpacity); - -void __arm_2d_impl_gray8_colour_filling_with_opacity(uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour, - uint_fast16_t hwRatio); - -void __arm_2d_impl_gray8_des_chn_msk_copy(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_chn_msk_copy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_des_chn_msk_copy_x_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_chn_msk_copy_xy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_chn_msk_copy_y_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_chn_msk_fill(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_des_chn_msk_fill_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_des_chn_msk_fill_x_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_des_chn_msk_fill_xy_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_des_chn_msk_fill_y_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_des_msk_copy(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_msk_copy_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_des_msk_copy_x_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_msk_copy_xy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_msk_copy_y_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_des_msk_fill(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_des_msk_fill_mirror(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_des_msk_fill_x_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_des_msk_fill_xy_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_des_msk_fill_y_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_masks_copy(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * __restrict ptTargetMaskSize, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_gray8_masks_copy_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_masks_copy_x_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_masks_copy_xy_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_masks_copy_y_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_masks_fill(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_masks_fill_mirror(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_masks_fill_x_mirror(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_masks_fill_xy_mirror(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_masks_fill_y_mirror(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_copy(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_copy_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_copy_x_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_copy_xy_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_copy_y_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_fill(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_fill_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_fill_x_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_fill_xy_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_1h_des_msk_fill_y_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_copy(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_copy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_copy_x_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_copy_xy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_copy_y_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_copy(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_copy_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_copy_x_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_copy_xy_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_copy_y_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_fill(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_fill_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_fill_x_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_fill_xy_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_des_chn_msk_fill_y_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_copy(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_copy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_copy_x_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_copy_xy_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_copy_y_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_fill(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_fill_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_fill_x_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_fill_xy_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_des_msk_fill_y_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_chn_msk_fill(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_src_chn_msk_fill_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_chn_msk_fill_x_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_src_chn_msk_fill_xy_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_src_chn_msk_fill_y_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_copy(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_copy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_copy_x_mirror(uint8_t * - __restrict - pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_copy_xy_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_copy_y_mirror(uint8_t * - __restrict - pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_fill(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_fill_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_fill_x_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_fill_xy_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_1h_des_msk_fill_y_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_copy(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_msk_copy_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_msk_copy_x_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_msk_copy_xy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_msk_copy_y_mirror(uint8_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_copy(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_copy_mirror(uint8_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_copy_x_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_copy_xy_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_copy_y_mirror(uint8_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_fill(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_fill_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_fill_x_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_fill_xy_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_des_chn_msk_fill_y_mirror(uint8_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint8_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_gray8_src_msk_fill(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_gray8_src_msk_fill_mirror(uint8_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_gray8_src_msk_fill_x_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_src_msk_fill_xy_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_src_msk_fill_y_mirror(uint8_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint8_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_gray8_transform( __arm_2d_param_copy_orig_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_gray8_transform_with_opacity( - __arm_2d_param_copy_orig_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_gray8_transform_with_src_mask( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_gray8_transform_with_src_mask_and_opacity( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_gray8_transform_with_src_chn_mask( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_gray8_transform_with_src_chn_mask_and_opacity( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_rgb16_1x1_paving(const uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb16_1x1_paving_x_mirror(const uint16_t * - __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb16_1x1_paving_xy_mirror(const uint16_t * - __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb16_1x1_paving_y_mirror(const uint16_t * - __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb16_1x2_paving(const uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb16_1x2_paving_x_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb16_1x2_paving_xy_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb16_1x2_paving_y_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb16_2x1_paving(const uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, uint16_t destHeight); - -void __arm_2d_impl_rgb16_2x1_paving_x_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_rgb16_2x1_paving_xy_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_rgb16_2x1_paving_y_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_rgb16_2x2_paving(const uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb16_2x2_paving_x_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb16_2x2_paving_xy_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb16_2x2_paving_y_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb16_cl_key_1x1_paving(const uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_1x1_paving_x_mirror(const uint16_t * - __restrict pSource, - int16_t iSourceStride, - uint16_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_1x1_paving_xy_mirror(const uint16_t * - __restrict pSource, - int16_t iSourceStride, - uint16_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_1x1_paving_y_mirror(const uint16_t * - __restrict pSource, - int16_t iSourceStride, - uint16_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_1x2_paving(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_1x2_paving_x_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_1x2_paving_xy_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_1x2_paving_y_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x1_paving(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x1_paving_x_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x1_paving_xy_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x1_paving_y_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x2_paving(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x2_paving_x_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x2_paving_xy_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_2x2_paving_y_mirror(const uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_copy(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_copy_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode, uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_copy_x_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_copy_xy_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_copy_y_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_fill(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_fill_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode, uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_fill_x_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_fill_xy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_cl_key_fill_y_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_colour_filling(uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb16_copy(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb16_copy(uint16_t * phwSource, int16_t iSourceStride, - uint16_t * phwTarget, int16_t iTargetStride, - arm_2d_size_t * ptCopySize); - -void __arm_2d_impl_rgb16_copy_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb16_copy_x_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb16_copy_xy_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb16_copy_y_mirror(uint16_t * __restrict pSource, - int16_t iSourceStride, - uint16_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb16_draw_pattern(uint8_t * __restrict pchSourceBase, - int32_t iOffset, int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint8_t chMode, uint16_t ForeColour, - uint16_t BackColour); - -void __arm_2d_impl_rgb16_draw_pattern_bg_comp(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t BackColour); - -void __arm_2d_impl_rgb16_draw_pattern_bg_fg(uint8_t * __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t ForeColour, - uint16_t BackColour); - -void __arm_2d_impl_rgb16_draw_pattern_bg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t BackColour); - -void __arm_2d_impl_rgb16_draw_pattern_fg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t ForeColour); - -void __arm_2d_impl_rgb16_draw_pattern_no_bg_comp(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb16_fill(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_rgb16_fill_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_rgb16_fill_x_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_rgb16_fill_xy_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb16_fill_y_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_rgb32_1x1_paving(const uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb32_1x1_paving_x_mirror(const uint32_t * - __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb32_1x1_paving_xy_mirror(const uint32_t * - __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb32_1x1_paving_y_mirror(const uint32_t * - __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize); - -void __arm_2d_impl_rgb32_1x2_paving(const uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb32_1x2_paving_x_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb32_1x2_paving_xy_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb32_1x2_paving_y_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows); - -void __arm_2d_impl_rgb32_2x1_paving(const uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, uint16_t destHeight); - -void __arm_2d_impl_rgb32_2x1_paving_x_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_rgb32_2x1_paving_xy_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_rgb32_2x1_paving_y_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight); - -void __arm_2d_impl_rgb32_2x2_paving(const uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb32_2x2_paving_x_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb32_2x2_paving_xy_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb32_2x2_paving_y_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols); - -void __arm_2d_impl_rgb32_cl_key_1x1_paving(const uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_1x1_paving_x_mirror(const uint32_t * - __restrict pSource, - int16_t iSourceStride, - uint32_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_1x1_paving_xy_mirror(const uint32_t * - __restrict pSource, - int16_t iSourceStride, - uint32_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_1x1_paving_y_mirror(const uint32_t * - __restrict pSource, - int16_t iSourceStride, - uint32_t * - __restrict pTarget, - int16_t iTargetStride, - const arm_2d_size_t * - __restrict ptSrcCopySize, - const arm_2d_size_t * - __restrict ptDstCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_1x2_paving(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_1x2_paving_x_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_1x2_paving_xy_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_1x2_paving_y_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x1_paving(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x1_paving_x_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x1_paving_xy_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x1_paving_y_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x2_paving(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x2_paving_x_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x2_paving_xy_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_2x2_paving_y_mirror(const uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - uint32_t Colour); - - -void __arm_2d_impl_rgb32_cl_key_copy(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_copy_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode, uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_copy_x_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_copy_xy_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_copy_y_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_fill(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_fill_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode, uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_fill_x_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_fill_xy_mirror(uint32_t * - __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_cl_key_fill_y_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_colour_filling(uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint32_t Colour); - -void __arm_2d_impl_rgb32_copy(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb32_copy(uint32_t * pwSource, int16_t iSourceStride, - uint32_t * pwTarget, int16_t iTargetStride, - arm_2d_size_t * ptCopySize); - -void __arm_2d_impl_rgb32_copy_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb32_copy_x_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb32_copy_xy_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb32_copy_y_mirror(uint32_t * __restrict pSource, - int16_t iSourceStride, - uint32_t * __restrict pTarget, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb32_draw_pattern(uint8_t * __restrict pchSourceBase, - int32_t iOffset, int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint8_t chMode, uint32_t ForeColour, - uint32_t BackColour); - -void __arm_2d_impl_rgb32_draw_pattern_bg_comp(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t BackColour); - -void __arm_2d_impl_rgb32_draw_pattern_bg_comp(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t hwBackColour); - -void __arm_2d_impl_rgb32_draw_pattern_bg_fg(uint8_t * __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t ForeColour, - uint32_t BackColour); - -void __arm_2d_impl_rgb32_draw_pattern_bg_fg(uint8_t * __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t hwForeColour, - uint32_t hwBackColour); - -void __arm_2d_impl_rgb32_draw_pattern_bg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t BackColour); - -void __arm_2d_impl_rgb32_draw_pattern_bg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t hwBackColour); - -void __arm_2d_impl_rgb32_draw_pattern_fg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t ForeColour); - -void __arm_2d_impl_rgb32_draw_pattern_fg_only(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t hwForeColour); - -void __arm_2d_impl_rgb32_draw_pattern_no_bg_comp(uint8_t * - __restrict pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb32_fill(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_rgb32_fill_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_rgb32_fill_x_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_rgb32_fill_xy_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb32_fill_y_mirror(uint32_t * __restrict pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint32_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_1h_des_msk_copy(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_1h_des_msk_copy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_1h_des_msk_copy_x_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_1h_des_msk_copy_xy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_1h_des_msk_copy_y_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_1h_des_msk_fill(uint16_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_1h_des_msk_fill_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_1h_des_msk_fill_x_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_1h_des_msk_fill_xy_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_1h_des_msk_fill_y_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_alpha_blending(uint16_t * __restrict phwSourceBase, - int16_t iSourceStride, - uint16_t * __restrict phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize, - uint_fast16_t hwRatio); - -void __arm_2d_impl_rgb565_alpha_blending(uint16_t * phwSourceBase, - int16_t iSourceStride, - uint16_t * phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * ptCopySize, - uint_fast16_t hwRatio); - -void __arm_2d_impl_rgb565_alpha_blending_colour_keying(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint_fast16_t hwRatio, - uint16_t hwColour); - -void __arm_2d_impl_rgb565_colour_filling_channel_mask(uint16_t * - __restrict pTarget, - int16_t iTargetStride, - uint32_t * - __restrict pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb565_colour_filling_channel_mask_opacity(uint16_t * - __restrict - pTarget, - int16_t - iTargetStride, - uint32_t * - __restrict - pwAlpha, - int16_t - iAlphaStride, - arm_2d_size_t * - __restrict - ptCopySize, - uint16_t Colour, - uint_fast16_t hwOpacity); - -void __arm_2d_impl_rgb565_colour_filling_mask(uint16_t * __restrict pTarget, - int16_t iTargetStride, - uint8_t * __restrict pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t Colour); - -void __arm_2d_impl_rgb565_colour_filling_mask_opacity(uint16_t * - __restrict pTarget, - int16_t iTargetStride, - uint8_t * - __restrict pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t Colour, - uint_fast16_t hwOpacity); - -void __arm_2d_impl_rgb565_colour_filling_with_opacity(uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint16_t Colour, - uint_fast16_t hwRatio); - -void __arm_2d_impl_rgb565_des_chn_msk_copy(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_chn_msk_copy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_des_chn_msk_copy_x_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_chn_msk_copy_xy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_chn_msk_copy_y_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_chn_msk_fill(uint16_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_des_chn_msk_fill_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_des_chn_msk_fill_x_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_des_chn_msk_fill_xy_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_des_chn_msk_fill_y_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_des_msk_copy(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_msk_copy_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_des_msk_copy_x_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_msk_copy_xy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_msk_copy_y_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_des_msk_fill(uint16_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint16_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_des_msk_fill_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_des_msk_fill_x_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_des_msk_fill_xy_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_des_msk_fill_y_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_masks_copy(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb565_masks_copy_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_masks_copy_x_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_masks_copy_xy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_masks_copy_y_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_masks_fill(uint16_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize, - uint8_t * __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_masks_fill_mirror(uint16_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_masks_fill_x_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_masks_fill_xy_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_masks_fill_y_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_copy(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_copy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_copy_x_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_copy_xy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_copy_y_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_fill(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_fill_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_fill_x_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_fill_xy_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_1h_des_msk_fill_y_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_copy(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_copy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_copy_x_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_copy_xy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_copy_y_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_copy(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_copy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_copy_x_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_copy_xy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_copy_y_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_fill(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_fill_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_fill_x_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_fill_xy_mirror( - uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_chn_msk_fill_y_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_copy(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_copy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_copy_x_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_copy_xy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_copy_y_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_fill(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_fill_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_fill_x_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_fill_xy_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_des_msk_fill_y_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_chn_msk_fill(uint16_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_src_chn_msk_fill_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_chn_msk_fill_x_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_src_chn_msk_fill_xy_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict - ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_src_chn_msk_fill_y_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint32_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_copy(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_copy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_copy_x_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_copy_xy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_copy_y_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_fill(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint8_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_fill_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_fill_x_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_fill_xy_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_1h_des_msk_fill_y_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint8_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_copy(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_copy_mirror(uint16_t * __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_msk_copy_x_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_copy_xy_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_copy_y_mirror(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_copy(uint16_t * - __restrict pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_copy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict ptCopySize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_copy_x_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_copy_xy_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_copy_y_mirror(uint16_t * - __restrict - pSourceBase, - int16_t - iSourceStride, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - pTargetBase, - int16_t - iTargetStride, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - arm_2d_size_t * - __restrict - ptCopySize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_fill(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t * - __restrict ptTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * - __restrict ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_fill_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_fill_x_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_fill_xy_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_des_chn_msk_fill_y_mirror(uint16_t * - __restrict - ptSourceBase, - int16_t - iSourceStride, - arm_2d_size_t * - __restrict - ptSourceSize, - uint8_t * - __restrict - ptSourceMaskBase, - int16_t - iSourceMaskStride, - arm_2d_size_t * - __restrict - ptSourceMaskSize, - uint16_t * - __restrict - ptTargetBase, - int16_t - iTargetStride, - arm_2d_size_t * - __restrict - ptTargetSize, - uint32_t * - __restrict - ptTargetMaskBase, - int16_t - iTargetMaskStride, - arm_2d_size_t * - __restrict - ptTargetMaskSize); - -void __arm_2d_impl_rgb565_src_msk_fill(uint16_t * __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __restrict ptSourceSize, - uint8_t * __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_src_msk_fill_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize, - uint32_t wMode); - -void __arm_2d_impl_rgb565_src_msk_fill_x_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_src_msk_fill_xy_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_src_msk_fill_y_mirror(uint16_t * - __restrict ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * - __restrict ptSourceSize, - uint8_t * - __restrict ptSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * - __restrict ptSourceMaskSize, - uint16_t * - __restrict ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptTargetSize); - -void __arm_2d_impl_rgb565_to_gray8( uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint8_t *__RESTRICT pchTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_cccn888_to_gray8(uint32_t *__RESTRICT pwSource, - int16_t iSourceStride, - uint8_t *__RESTRICT pchwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_gray8_to_cccn888(uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint32_t *__RESTRICT pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_rgb565_to_cccn888(uint16_t * __restrict phwSourceBase, - int16_t iSourceStride, - uint32_t * __restrict pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __restrict ptCopySize); - -void __arm_2d_impl_rgb565_transform(__arm_2d_param_copy_orig_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_rgb565_transform_with_opacity( - __arm_2d_param_copy_orig_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_rgb565_transform_with_src_mask( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_rgb565_transform_with_src_mask_and_opacity( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -void __arm_2d_impl_rgb565_transform_with_src_chn_mask( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo); - -void __arm_2d_impl_rgb565_transform_with_src_chn_mask_and_opacity( - __arm_2d_param_copy_orig_msk_t * ptParam, - __arm_2d_transform_info_t * ptInfo, - uint_fast16_t hwRatio); - -#if defined(__clang__) -# pragma clang diagnostic pop -#elif __IS_COMPILER_ARM_COMPILER_5__ -# pragma diag_warning 174,177,188,68,513,144,64 -#elif __IS_COMPILER_IAR__ -# pragma diag_warning=pe111 -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/__arm_2d_impl.h b/package/Arm2D/Library/Include/__arm_2d_impl.h deleted file mode 100644 index ae177a578..000000000 --- a/package/Arm2D/Library/Include/__arm_2d_impl.h +++ /dev/null @@ -1,823 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_impl.h - * Description: header files for internal users or professional developers - * - * $Date: 09. Aug 2022 - * $Revision: V.1.2.2 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_ACCELERATION_H__ -# define __ARM_2D_ACCELERATION_H__ 1 - -/*============================ INCLUDES ======================================*/ - -#include "arm_2d.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wmissing-declarations" -# pragma clang diagnostic ignored "-Wpadded" -#elif __IS_COMPILER_ARM_COMPILER_5__ -# pragma diag_suppress 174,177,188,68,513,144,64 -#elif __IS_COMPILER_IAR__ -# pragma diag_suppress=Pe301 -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-value" -#endif - -/*============================ MACROS ========================================*/ -#undef this -#define this (*ptThis) - -#undef OP_CORE -#define OP_CORE this.use_as__arm_2d_op_core_t - -#define ARM_2D_IMPL(__TYPE, ...) \ - __TYPE *ptThis = (__TYPE *)(NULL,##__VA_ARGS__); \ - if (NULL == ptThis) { \ - ptThis = (__TYPE *)&ARM_2D_CTRL.DefaultOP; \ - } - -/*============================ MACROFIED FUNCTIONS ===========================*/ - -#define ARM_2D_TRY_ACCELERATION(__ID, __FUNC_PROTOTYPE, ...) \ - if ( (NULL != OP_CORE.ptOp->Info.LowLevelIO.IO[__ID]->HW) \ - && (NULL != OP_CORE.ptOp->Info.LowLevelIO.IO[__ID])) { \ - tResult = \ - (*(__FUNC_PROTOTYPE *)OP_CORE.ptOp->Info.LowLevelIO.IO[__ID]->HW)( \ - ptTask, \ - ##__VA_ARGS__); \ - } - -#define ARM_2D_RUN_DEFAULT(__ID, __FUNC_PROTOTYPE, ...) \ - if ( (NULL != OP_CORE.ptOp->Info.LowLevelIO.IO[__ID]->SW) \ - && (NULL != OP_CORE.ptOp->Info.LowLevelIO.IO[__ID])) { \ - tResult = \ - (*(__FUNC_PROTOTYPE *)OP_CORE.ptOp->Info.LowLevelIO.IO[__ID]->SW)( \ - ptTask, \ - ##__VA_ARGS__); \ - } else { \ - tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; \ - } - -#define __ARM_2D_PIXEL_BLENDING_GRAY8(__SRC_ADDR, __DES_ADDR, __TRANS) \ - do { \ - uint16_t hwOPA = 256 - (__TRANS); \ - const uint8_t *pchSrc = (uint8_t *)(__SRC_ADDR); \ - uint8_t *pchDes = (uint8_t *)(__DES_ADDR); \ - \ - *pchDes = ((uint16_t)( ((uint16_t)(*pchSrc++) * hwOPA) \ - + ((uint16_t)(*pchDes) * (__TRANS)) \ - ) >> 8); \ - } while(0) - -#define __ARM_2D_PIXEL_BLENDING_RGB565(__SRC_ADDR, __DES_ADDR, __TRANS) \ - do { \ - uint16_t hwOPA = 256 - (__TRANS); \ - __arm_2d_color_fast_rgb_t tSrcPix, tTargetPix; \ - uint16_t *phwTargetPixel = (__DES_ADDR); \ - __arm_2d_rgb565_unpack(*(__SRC_ADDR), &tSrcPix); \ - __arm_2d_rgb565_unpack(*phwTargetPixel, &tTargetPix); \ - \ - for (int i = 0; i < 3; i++) { \ - uint16_t hwTemp = \ - (uint16_t) (tSrcPix.BGRA[i] * hwOPA) + \ - (tTargetPix.BGRA[i] * (__TRANS)); \ - tTargetPix.BGRA[i] = (uint16_t) (hwTemp >> 8); \ - } \ - \ - /* pack merged stream */ \ - *phwTargetPixel = __arm_2d_rgb565_pack(&tTargetPix); \ - } while(0) - -#define __ARM_2D_PIXEL_BLENDING_CCCN888(__SRC_ADDR, __DES_ADDR, __TRANS) \ - do { \ - uint16_t hwOPA = 256 - (__TRANS); \ - /* do not change alpha */ \ - uint_fast8_t ARM_2D_SAFE_NAME(n) = sizeof(uint32_t) - 1; \ - const uint8_t *pchSrc = (uint8_t *)(__SRC_ADDR); \ - uint8_t *pchDes = (uint8_t *)(__DES_ADDR); \ - \ - do { \ - *pchDes = ( ((uint_fast16_t)(*pchSrc++) * hwOPA) \ - + ((uint_fast16_t)(*pchDes) * (__TRANS)) \ - ) >> 8; \ - pchDes++; \ - } while(--ARM_2D_SAFE_NAME(n)); \ - } while(0) - - - -#define __ARM_2D_PIXEL_BLENDING_OPA_GRAY8(__SRC_ADDR, __DES_ADDR, __OPA) \ - do { \ - uint16_t hwTrans = 256 - (__OPA); \ - const uint8_t *pchSrc = (uint8_t *)(__SRC_ADDR); \ - uint8_t *pchDes = (uint8_t *)(__DES_ADDR); \ - \ - *pchDes = ((uint16_t)( ((uint16_t)(*pchSrc++) * (__OPA)) \ - + ((uint16_t)(*pchDes) * hwTrans) \ - ) >> 8); \ - } while(0) - -#define __ARM_2D_PIXEL_BLENDING_OPA_RGB565(__SRC_ADDR, __DES_ADDR, __OPA) \ - do { \ - uint16_t hwTrans = 256 - (__OPA); \ - __arm_2d_color_fast_rgb_t tSrcPix, tTargetPix; \ - uint16_t *phwTargetPixel = (__DES_ADDR); \ - __arm_2d_rgb565_unpack(*(__SRC_ADDR), &tSrcPix); \ - __arm_2d_rgb565_unpack(*phwTargetPixel, &tTargetPix); \ - \ - for (int i = 0; i < 3; i++) { \ - uint16_t hwTemp = \ - (uint16_t) (tSrcPix.BGRA[i] * (__OPA)) + \ - (tTargetPix.BGRA[i] * hwTrans); \ - tTargetPix.BGRA[i] = (uint16_t) (hwTemp >> 8); \ - } \ - \ - /* pack merged stream */ \ - *phwTargetPixel = __arm_2d_rgb565_pack(&tTargetPix); \ - } while(0) - -#define __ARM_2D_PIXEL_BLENDING_OPA_CCCN888(__SRC_ADDR, __DES_ADDR, __OPA) \ - do { \ - uint16_t hwTrans = 256 - (__OPA); \ - /* do not change alpha */ \ - uint_fast8_t ARM_2D_SAFE_NAME(n) = sizeof(uint32_t) - 1; \ - const uint8_t *pchSrc = (uint8_t *)(__SRC_ADDR); \ - uint8_t *pchDes = (uint8_t *)(__DES_ADDR); \ - \ - do { \ - *pchDes = ( ((uint_fast16_t)(*pchSrc++) * (__OPA)) \ - + ((uint_fast16_t)(*pchDes) * hwTrans) \ - ) >> 8; \ - pchDes++; \ - } while(--ARM_2D_SAFE_NAME(n)); \ - } while(0) - -#define __ARM_2D_PIXEL_AVERAGE_RGB565(__PIXEL_IN, __ALPHA) \ - do { \ - __arm_2d_color_fast_rgb_t tTempColour; \ - __arm_2d_rgb565_unpack((__PIXEL_IN), &tTempColour); \ - tPixel.R += tTempColour.R * (__ALPHA); \ - tPixel.G += tTempColour.G * (__ALPHA); \ - tPixel.B += tTempColour.B * (__ALPHA); \ - } while(0) - - -#define __ARM_2D_PIXEL_AVERAGE_CCCN888(__PIXEL_IN, __ALPHA) \ - do { \ - arm_2d_color_rgb888_t tTempColour = {.tValue = (__PIXEL_IN)}; \ - tPixel.R += tTempColour.u8R * (__ALPHA); \ - tPixel.G += tTempColour.u8G * (__ALPHA); \ - tPixel.B += tTempColour.u8B * (__ALPHA); \ - } while(0) - -#define __ARM_2D_PIXEL_AVERAGE_GRAY8(__PIXEL_IN, __ALPHA) \ - do { \ - tPixel += (uint16_t)(__PIXEL_IN) * (uint16_t)(__ALPHA); \ - } while(0) - -/*============================ TYPES =========================================*/ - -typedef struct __arm_2d_point_adj_alpha_t{ - struct { - arm_2d_location_t tOffset; - uint_fast8_t chAlpha; - }tMatrix[4]; -} __arm_2d_point_adj_alpha_t; - - - - -//! \name Operation Index: used for logging and debugging purpose -//! @{ -enum { - /*------------ arm-2d operation idx begin --------------*/ - __ARM_2D_OP_IDX_BARRIER, - __ARM_2D_OP_IDX_SYNC = __ARM_2D_OP_IDX_BARRIER, - - __ARM_2D_OP_IDX_COPY, - __ARM_2D_OP_IDX_COPY_ONLY, - __ARM_2D_OP_IDX_COPY_WITH_X_MIRROR, - __ARM_2D_OP_IDX_COPY_WITH_Y_MIRROR, - __ARM_2D_OP_IDX_COPY_WITH_XY_MIRROR, - - __ARM_2D_OP_IDX_FILL_ONLY, - __ARM_2D_OP_IDX_FILL_WITH_X_MIRROR, - __ARM_2D_OP_IDX_FILL_WITH_Y_MIRROR, - __ARM_2D_OP_IDX_FILL_WITH_XY_MIRROR, - - __ARM_2D_OP_IDX_COPY_WITH_COLOUR_KEYING, - __ARM_2D_OP_IDX_COPY_WITH_MASKS, - __ARM_2D_OP_IDX_COPY_WITH_SOURCE_MASK, - __ARM_2D_OP_IDX_COPY_WITH_TARGET_MASK, - __ARM_2D_OP_IDX_FILL_COLOUR, - __ARM_2D_OP_IDX_FILL_COLOUR_WITH_COLOUR_KEYING, - __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK, - __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK_AND_OPACITY, - - __ARM_2D_OP_IDX_ALPHA_BLENDING, - __ARM_2D_OP_IDX_ALPHA_BLENDING_WITH_COLOUR_KEYING, - __ARM_2D_OP_IDX_ALPHA_FILL_COLOUR, - __ARM_2D_OP_IDX_ALPHA_FILL_COLOUR_WITH_COLOUR_KEYING, - - __ARM_2D_OP_IDX_DRAW_POINT, - __ARM_2D_OP_IDX_DRAW_PATTERN, - - __ARM_2D_OP_IDX_COLOUR_FORMAT_CONVERSION, - - __ARM_2D_OP_IDX_TRANSFORM, - //__ARM_2D_OP_IDX_TRANSFORM_WITH_MASKS, //!< todo in v1.xx - __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK, - //__ARM_2D_OP_IDX_TRANSFORM_WITH_TARGET_MASK, //!< todo in v1.xx - - __ARM_2D_OP_IDX_TRANSFORM_WITH_OPACITY, - //__ARM_2D_OP_IDX_TRANSFORM_WITH_MASKS_AND_OPACITY, //!< todo in v1.xx - __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK_AND_OPACITY, - //__ARM_2D_OP_IDX_TRANSFORM_WITH_TARGET_MASK_AND_OPACITY, //!< todo in v1.xx - /*------------ cmsisi-2d operation idx end --------------*/ -}; -//! @} - - -typedef struct __arm_2d_sub_task_t __arm_2d_sub_task_t; - - -typedef arm_fsm_rt_t __arm_2d_io_func_t(__arm_2d_sub_task_t *ptTask); - -typedef struct __arm_2d_low_level_io_t { - __arm_2d_io_func_t *SW; - __arm_2d_io_func_t *HW; -} __arm_2d_low_level_io_t; - - -typedef struct __arm_2d_tile_param_t { - void * pBuffer; - int32_t nOffset; - int16_t iStride; - arm_2d_color_info_t tColour; - - uint8_t bInvalid : 1; - uint8_t bDerivedResource : 1; - uint8_t : 6; - - arm_2d_region_t tValidRegion; - arm_2d_tile_t *ptDerivedResource; -} __arm_2d_tile_param_t; - -typedef struct __arm_2d_param_copy_t { - __arm_2d_tile_param_t tSource; - __arm_2d_tile_param_t tTarget; - arm_2d_size_t tCopySize; -} __arm_2d_param_copy_t; - -typedef struct __arm_2d_param_copy_msk_t { - implement(__arm_2d_param_copy_t); - - __arm_2d_tile_param_t tSrcMask; - __arm_2d_tile_param_t tDesMask; -} __arm_2d_param_copy_msk_t; - -typedef struct __arm_2d_param_copy_orig_t { - implement(__arm_2d_param_copy_t); - - __arm_2d_tile_param_t tOrigin; - -} __arm_2d_param_copy_orig_t; - -typedef struct __arm_2d_param_copy_orig_msk_t { - implement(__arm_2d_param_copy_orig_t); - - __arm_2d_tile_param_t tOrigMask; - __arm_2d_tile_param_t tDesMask; - -} __arm_2d_param_copy_orig_msk_t; - -typedef struct __arm_2d_param_fill_t { - __arm_2d_tile_param_t tSource; - __arm_2d_tile_param_t tTarget; -} __arm_2d_param_fill_t; - -typedef struct __arm_2d_param_fill_msk_t { - implement(__arm_2d_param_fill_t); - - __arm_2d_tile_param_t tSrcMask; - __arm_2d_tile_param_t tDesMask; -} __arm_2d_param_fill_msk_t; - -typedef struct __arm_2d_param_fill_orig_t { - implement(__arm_2d_param_fill_t); - - __arm_2d_tile_param_t tOrigin; - -} __arm_2d_param_fill_orig_t; - -struct __arm_2d_sub_task_t{ -ARM_PRIVATE( - __arm_2d_sub_task_t *ptNext; - - arm_2d_op_core_t *ptOP; - - uint8_t chLowLeveIOIndex; //!< the type of IO interface - uint8_t bIsCPL : 1; - uint8_t : 7; - uint16_t : 16; - - union { - __arm_2d_tile_param_t tTileProcess; - - __arm_2d_param_copy_t tCopy; - __arm_2d_param_copy_msk_t tCopyMask; - __arm_2d_param_copy_orig_t tCopyOrig; //!< for transform - __arm_2d_param_copy_orig_msk_t tCopyOrigMask; //!< for transform with masks - - __arm_2d_param_fill_t tFill; - __arm_2d_param_fill_msk_t tFillMask; - __arm_2d_param_fill_orig_t tFillOrig; - }Param; -)}; - - -struct __arm_2d_op_control { -ARM_PRIVATE( - __arm_2d_sub_task_t *ptFreeList; - struct { - __arm_2d_sub_task_t *ptHead; - __arm_2d_sub_task_t *ptTail; - } TaskFIFO; - - struct { - arm_2d_op_core_t *ptHead; - arm_2d_op_core_t *ptTail; - } OPFIFO; - - uint16_t hwFreeCount; - uint16_t hwTaskCount; - uint16_t hwBookCount; - uint16_t : 16; - - arm_2d_tile_t *ptDefaultFrameBuffer; - - union { - arm_2d_op_t tBasic; - arm_2d_op_fill_cl_t tFillColour; - arm_2d_op_fill_cl_msk_t tFillColourMask; - arm_2d_op_fill_cl_opc_t tFillColourOpacity; - arm_2d_op_src_t tWithSource; - - arm_2d_op_alpha_t tAlpha; - arm_2d_op_alpha_cl_key_t tAlphaColourKeying; - arm_2d_op_alpha_fill_cl_msk_opc_t tAlphaFillColourMaskOpacity; - arm_2d_op_cp_msk_t tCopyMasks; - - arm_2d_op_drw_patn_t tDrawPattern; - arm_2d_op_trans_t tTransform; - arm_2d_op_trans_opa_t tRotateOpacity; - - arm_2d_op_msk_t tBasicMask; - arm_2d_op_src_msk_t tSourceMask; - arm_2d_op_src_orig_msk_t tSourceOrigMask; - } DefaultOP; -)}; - - - -/*============================ GLOBAL VARIABLES ==============================*/ -extern -const struct __arm_2d_io_table __ARM_2D_IO_TABLE; - -extern struct __arm_2d_op_control ARM_2D_CTRL; - -/*============================ PROTOTYPES ====================================*/ - -/*----------------------------------------------------------------------------* - * Pipeline * - *----------------------------------------------------------------------------*/ -extern -arm_fsm_rt_t __arm_2d_op_invoke(arm_2d_op_core_t *ptOP); - -extern -/*! \brief sync up with operation - *! \retval true operation is busy - *! \retval false operation isn't busy - */ -bool __arm_2d_op_acquire(arm_2d_op_core_t *ptOP); - -/*! \note This API should be called by both arm_2d_task and hardware - *! accelerator to indicate the completion of a sub task - */ -extern -void __arm_2d_notify_sub_task_cpl(__arm_2d_sub_task_t *ptTask, - arm_fsm_rt_t tResult, - bool bFromHW); - -extern -arm_fsm_rt_t __arm_2d_op_frontend_op_decoder(arm_2d_op_core_t *ptThis); - - -extern -arm_fsm_rt_t __arm_2d_op_depose(arm_2d_op_core_t *ptThis, - arm_fsm_rt_t tResult); - -extern -void __arm_2d_sub_task_depose(arm_2d_op_core_t *ptOP); -/*----------------------------------------------------------------------------* - * Utilities * - *----------------------------------------------------------------------------*/ -extern -__arm_2d_point_adj_alpha_t -__arm_2d_point_get_adjacent_alpha_fp(arm_2d_point_float_t *ptPoint); - -extern -__arm_2d_point_adj_alpha_t -__arm_2d_point_get_adjacent_alpha_q16(arm_2d_point_fx_t *ptPoint); - -extern -arm_2d_err_t __arm_mask_validate( const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - uint32_t wMode); - -extern -ARM_NONNULL(1,2) -const arm_2d_tile_t *__arm_2d_tile_get_root(const arm_2d_tile_t *ptTile, - arm_2d_region_t *ptValidRegion, - arm_2d_location_t *ptOffset, - arm_2d_tile_t **ppFirstDerivedChild); - -/*----------------------------------------------------------------------------* - * Default Software Implementations * - *----------------------------------------------------------------------------*/ - -extern -arm_fsm_rt_t __arm_2d_sw_draw_point(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_draw_pattern( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_draw_pattern( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_draw_pattern( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_only( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_only( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_only( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_x_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_x_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_x_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_y_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_y_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_y_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_xy_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_xy_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_xy_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_only( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_only( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_only( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_x_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_x_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_x_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_y_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_y_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_y_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_xy_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_xy_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_xy_mirror( __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_tile_copy_with_masks( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_tile_fill_with_masks( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_tile_copy_with_masks( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_tile_fill_with_masks( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_tile_copy_with_masks( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_tile_fill_with_masks( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_tile_copy_with_src_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_tile_fill_with_src_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_tile_copy_with_src_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_tile_fill_with_src_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_tile_copy_with_src_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_tile_fill_with_src_mask( - __arm_2d_sub_task_t *ptTask); - - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_tile_copy_with_des_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_tile_fill_with_des_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_tile_copy_with_des_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_tile_fill_with_des_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_tile_copy_with_des_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_tile_fill_with_des_mask( - __arm_2d_sub_task_t *ptTask); - - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_c8bit_sw_colour_filling(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb16_sw_colour_filling(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb32_sw_colour_filling(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_colour_filling_with_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_colour_filling_with_mask( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_colour_filling_with_mask( - __arm_2d_sub_task_t *ptTask); - - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_colour_filling_with_mask_and_opacity( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_colour_filling_with_mask_and_opacity( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_colour_filling_with_mask_and_opacity( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_alpha_blending(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_alpha_blending(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_alpha_blending(__arm_2d_sub_task_t *ptTask); - - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_alpha_blending_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_alpha_blending_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_alpha_blending_with_colour_keying( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_colour_filling_with_opacity( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_colour_filling_with_opacity( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_colour_filling_with_opacity( - __arm_2d_sub_task_t *ptTask); -extern -arm_fsm_rt_t __arm_2d_sw_convert_colour_to_gray8(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_sw_convert_colour_to_rgb565(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_sw_convert_colour_to_rgb888(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_gray8_sw_transform(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_rgb565_sw_transform(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t __arm_2d_cccn888_sw_transform(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_gray8_sw_transform_with_alpha(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_rgb565_sw_transform_with_alpha(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_cccn888_sw_transform_with_alpha(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_gray8_sw_transform_with_src_mask(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_rgb565_sw_transform_with_src_mask(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_cccn888_sw_transform_with_src_mask(__arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_gray8_sw_transform_with_src_mask_and_opacity( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_rgb565_sw_transform_with_src_mask_and_opacity( - __arm_2d_sub_task_t *ptTask); - -extern -arm_fsm_rt_t -__arm_2d_cccn888_sw_transform_with_src_mask_and_opacity( - __arm_2d_sub_task_t *ptTask); -/*========================== POST INCLUDES ===================================*/ -#include "__arm_2d_direct.h" - -#if defined(__clang__) -# pragma clang diagnostic pop -#elif __IS_COMPILER_ARM_COMPILER_5__ -# pragma diag_warning 174,177,188,68,513,144,64 -#elif __IS_COMPILER_IAR__ -# pragma diag_warning=pe111 -#endif - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/package/Arm2D/Library/Include/__arm_2d_math.h b/package/Arm2D/Library/Include/__arm_2d_math.h deleted file mode 100644 index 632bb5247..000000000 --- a/package/Arm2D/Library/Include/__arm_2d_math.h +++ /dev/null @@ -1,189 +0,0 @@ -/****************************************************************************** - * @file arm_2d_math.h - * @brief Public header file for Arm-2D Library - * @version V1.0.0 - * @date 16. June 2021 - ******************************************************************************/ -/* - * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __ARM_2D_MATH_H__ -#define __ARM_2D_MATH_H__ - -/*============================ INCLUDES ======================================*/ - - -/*! \note this header file is not standalone, and please always use it after - *! #include "arm_2d_features.h" - *! #include "arm_2d_utils.h" - *! in your c source file if you insist to use it explicity. - */ - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wundef" -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -#endif - -#if defined(__IS_COMPILER_ARM_COMPILER_5__) \ - && defined(__ARM_2D_HAS_HELIUM__) && __ARM_2D_HAS_HELIUM__ -# warning 'Arm Compiler 5 doesn\'t support Armv8.1-M architecture, please use \ -Arm Compiler 5 instead. If you insist using Arm Compiler 5,\ - __ARM_2D_HAS_HELIUM__ is forced to 0.' -# undef __ARM_2D_HAS_HELIUM__ -# define __ARM_2D_HAS_HELIUM__ 0 -#endif - - -#if defined(__ARM_2D_HAS_HELIUM__) && __ARM_2D_HAS_HELIUM__ -#include -#else -// if MVE is not defined, use float type for bilinear interpolation -typedef float float16_t; -#endif - -#if __ARM_2D_HAS_DSP__ - -#if defined(__IS_COMPILER_ARM_COMPILER_5__) -# include "armdsp.h" -#else -# include -#endif - -#endif - -#include "arm_math.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/*============================ MACROS ========================================*/ - -/*----------------------------------------------------------------------------* - * Math * - *----------------------------------------------------------------------------*/ -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef _BV -# define _BV(__BIT) (1 << (__BIT)) -#endif - -#ifndef ABS -# define ABS(x) ((x) > 0 ? (x) : -(x)) -#endif - -#undef MULTFX -/* 32 bit multiplication with high part extraction */ -#define MULTFX(x,y) (q31_t)((q63_t)((q63_t) (x) * (q63_t)(y)) >> 32) - -/* Q16 multiplication */ -#undef MUL_Q16 -#define MUL_Q16(x,y) (q31_t)((q63_t)((q63_t) (x) * (q63_t)(y)) >> 16) - - -#define ARM_PIX_SCLTYP(sz) ARM_CONNECT2(ARM_CONNECT2(uint, sz), _t) - -#define ARM_2D_ANGLE(__ANGLE) ((float)((float)(__ANGLE) * 3.1415926f / 180.0f)) - -#if __ARM_2D_HAS_DSP__ - -#undef __QDADD -#undef __QDSUB -#define __QDADD(X, Y) __qadd(X, __qdbl(Y)) -#define __QDSUB(X, Y) __qsub(X, __qdbl(Y)) - -#define __LARGEINVF32 100.0f - -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -#elif defined(__ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT__) -/* - * @brief C custom defined QDADD - */ -__STATIC_FORCEINLINE int32_t __QDADD( - int32_t x, - int32_t y) -{ - return x + y * 2; -} -/* - * @brief C custom defined QDSUB - */ -__STATIC_FORCEINLINE int32_t __QDSUB( - int32_t x, - int32_t y) -{ - return x - y * 2; -} -#else - -/* - * @brief C custom defined QDADD - */ -__STATIC_FORCEINLINE int32_t __QDADD( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x + (q63_t)y*2))); -} -/* - * @brief C custom defined QDSUB - */ -__STATIC_FORCEINLINE int32_t __QDSUB( - int32_t x, - int32_t y) -{ - return ((int32_t)(clip_q63_to_q31((q63_t)x - (q63_t)2*y))); -} - -#endif - - - -#if defined(__clang__) -# pragma clang diagnostic pop -#elif __IS_COMPILER_ARM_COMPILER_5__ -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - - -#endif /* end of __ARM_2D_MATH_H__ */ - diff --git a/package/Arm2D/Library/Include/__arm_2d_math_helium.h b/package/Arm2D/Library/Include/__arm_2d_math_helium.h deleted file mode 100644 index 965c60dc6..000000000 --- a/package/Arm2D/Library/Include/__arm_2d_math_helium.h +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_math_helium.h - * Description: Provides helium math routines - * - * $Date: 29. Sep 2021 - * $Revision: V 0.0.2 - * - * Target Processor: Cortex-M cores with Helium - * - * -------------------------------------------------------------------- */ - - - -#ifndef __ARM_2D_MATH_HELIUM_H__ -#define __ARM_2D_MATH_HELIUM_H__ - - -#if defined(__ARM_2D_HAS_HELIUM__) && __ARM_2D_HAS_HELIUM__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d.h" -#include - -#if __ARM_2D_HAS_HELIUM_FLOAT__ -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define vec_rgb8_t uint8x16_t -#define vec_rgb16_t uint16x8_t -#define vec_rgb32_t uint32x4_t - -#define ARM_PIX_SCLTYP(sz) ARM_CONNECT2(ARM_CONNECT2(uint, sz), _t) -#define ARM_PIX_VECTYP(sz) ARM_CONNECT2(ARM_CONNECT2(vec_rgb,sz), _t) - -#define vld8 vldrb -#define vld16 vldrh -#define vld32 vldrw -#define vst8 vstrb -#define vst16 vstrh -#define vst32 vstrw - -#define ARM_VLD_ASM(sz) ARM_CONNECT2(vld, sz) -#define ARM_VST_ASM(sz) ARM_CONNECT2(vst, sz) - -#define ARM_VLD1_ASM(sz) ARM_TO_STRING(ARM_VLD_ASM(sz).ARM_CONNECT2(u,sz)) -#define ARM_VST1_ASM(sz) ARM_TO_STRING(ARM_VST_ASM(sz).ARM_CONNECT2(u,sz)) -#define ARM_VLD1Z_ASM(sz) ARM_TO_STRING(ARM_VLD_ASM(sz)t.ARM_CONNECT2(u,sz)) -#define ARM_VST1P_ASM(sz) ARM_TO_STRING(ARM_VST_ASM(sz)t.ARM_CONNECT2(u,sz)) -#define ARM_VLDWID_ASM(sz, wid) ARM_TO_STRING(ARM_VLD_ASM(sz).ARM_CONNECT2(u,wid)) -#define ARM_VSTNRW_ASM(sz, nrw) ARM_TO_STRING(ARM_VLD_ASM(sz).ARM_CONNECT2(u,nrw)) - - -/* number of vector elements */ -#define ARM_PIX_VECELT(sz) (128/sz) - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ - - - - -#if __ARM_2D_HAS_HELIUM_FLOAT__ - -#define __PIF16 3.14159265358979F16 -#define __CALIBF16 0.009f16 -/* avoid 0 division */ -/* should not be too small as inverse could grows to F16 infinite 65e3 when */ -/* multiplied with numerator */ -#define __EPSF16 1e-03f16 - -#define __LARGEINVF32 100.0f - -#define __PI_2_F16 (__PIF16/2.0f16) -#define INV_NEWTON_INIT_F16 0x7773 - -#define INFINITY_F16 ((float16_t)__builtin_inf()) - - -#define ATANF_LUT \ - -0.0443265554792128, /*p7*/ \ - -0.3258083974640975, /*p3*/ \ - +0.1555786518463281, /*p5*/ \ - +0.9997878412794807 /*p1*/ \ - -extern const float16_t sinTable_f16[FAST_MATH_TABLE_SIZE + 1]; -extern const float16_t atanf_lut_f16[4]; - -#define INVSQRT_MAGIC_F16 0x59ba /* ( 0x1ba = 0x3759df >> 13) */ - -/* 2D point floating point vector types */ -typedef struct arm_2d_point_f32x4_t { - float32x4_t X; - float32x4_t Y; -} arm_2d_point_f32x4_t; - -typedef struct arm_2d_point_f16x8_t { - float16x8_t X; - float16x8_t Y; -} arm_2d_point_f16x8_t; - -#endif - -/* 2D point integer point vector types */ -typedef struct arm_2d_point_s16x8_t { - int16x8_t X; - int16x8_t Y; -} arm_2d_point_s16x8_t; - -typedef struct arm_2d_point_s32x4_t { - int32x4_t X; - int32x4_t Y; -} arm_2d_point_s32x4_t; - - - -#if __ARM_2D_HAS_HELIUM_FLOAT__ == 1 - -__STATIC_FORCEINLINE float16x8_t vsin_f16( - float16x8_t vecIn) -{ - q15x8_t vecMask = vdupq_n_s16(0x1ff); - float16x8_t vecOne = vdupq_n_f16(1.0f16); - float16x8_t vecTmpFlt0, vecTmpFlt1; - float16x8_t vecSin0, vecSin1; - q15x8_t vecTmpFx; - - - /* - * input x is in radians - * Scale the input to [0 1] range from [0 2*PI] - * divide input by 2*pi (add 0.25 (pi/2) to read sine table) - * in = x * 0.159154943092f + 0.25f - */ - vecTmpFlt0 = vmulq(vecIn, (float16_t) (1.0 / (2.0 * PI))); - /* - * Calculation of floor value of input - */ - vecTmpFx = vcvtmq_s16_f16(vecTmpFlt0); - vecTmpFlt1 = vcvtq_f16_s16(vecTmpFx); - /* - * Map input value to [0 1] - */ - vecTmpFlt1 = vecTmpFlt0 - vecTmpFlt1; - /* - * Calculation of index of the table - * findex = (float16_t) FAST_MATH_TABLE_SIZE * in; - */ - vecTmpFlt0 = vecTmpFlt1 * (float16_t) FAST_MATH_TABLE_SIZE; - /* - * index = ((uint16_t)findex) & 0x1ff; - */ - vecTmpFx = vcvtq_s16_f16(vecTmpFlt0); - vecTmpFx = vandq(vecTmpFx, vecMask); - /* - * fractional value calculation - * fract = findex - (float16_t) index; - */ - vecTmpFlt1 = vcvtq_f16_s16(vecTmpFx); - vecTmpFlt0 = vecTmpFlt0 - vecTmpFlt1; - /* - * Read two nearest values of input value from the cos table - * a = sinTable_f16[index]; - */ - vecSin0 = vldrhq_gather_shifted_offset_f16(sinTable_f16, vecTmpFx); - /* - * b = sinTable_f16[index+1]; - */ - vecTmpFx = vecTmpFx + 1; - vecSin1 = vldrhq_gather_shifted_offset_f16(sinTable_f16, vecTmpFx); - /* - * 1.0f - fract - */ - vecTmpFlt1 = vecOne - vecTmpFlt0; - /* - * fract * b; - */ - vecTmpFlt0 = vecTmpFlt0 * vecSin1; - /* - * Linear interpolation process - * cosVal = (1.0f-fract)*a + fract*b; - */ - vecTmpFlt0 = vfmaq(vecTmpFlt0, vecSin0, vecTmpFlt1); - - // set 'tiny' values to x (F16 precision limit) - vecTmpFlt0 = vpselq(vecIn, vecTmpFlt0, vcmpleq(vabsq(vecIn), 0.05f16)); - - return vecTmpFlt0; -} - - - -__STATIC_FORCEINLINE float16x8_t vcos_f16( - float16x8_t x) -{ - return vsin_f16(x + __PI_2_F16); -} - - - -/* fast inverse approximation (4x newton) */ -__STATIC_INLINE float16x8_t vrecip_hiprec_f16( - float16x8_t x) -{ - q15x8_t m; - float16x8_t b; - any16x8_t xinv; - float16x8_t ax = vabsq(x); - - xinv.f = ax; - - m = 0x03c00 - (xinv.i & 0x07c00); - xinv.i = xinv.i + m; - xinv.f = 1.41176471f16 - 0.47058824f16 * xinv.f; - xinv.i = xinv.i + m; - - b = 2.0f16 - xinv.f * ax; - xinv.f = xinv.f * b; - - b = 2.0f16 - xinv.f * ax; - xinv.f = xinv.f * b; - - b = 2.0f16 - xinv.f * ax; - xinv.f = xinv.f * b; - - b = 2.0f16 - xinv.f * ax; - xinv.f = xinv.f * b; - - xinv.f = vdupq_m(xinv.f, INFINITY_F16, vcmpeqq(x, 0.0f)); - /* - * restore sign - */ - xinv.f = vnegq_m(xinv.f, xinv.f, vcmpltq(x, 0.0f)); - - return xinv.f; -} - -__STATIC_FORCEINLINE float16x8_t vrecip_lowprec_f16(float16x8_t vecIn) -{ - float16x8_t vecSx, vecW; - any16x8_t r; - - vecSx = vabsq(vecIn); - r.f = vecSx; - - r.i = vdupq_n_u16(INV_NEWTON_INIT_F16) - r.i; - - vecW = vmulq(vecSx, r.f); - vecW = vsubq(vdupq_n_f16((float16_t)2), vecW); - - r.f = vmulq(r.f, vecW); - - r.f = vdupq_m(r.f, (float16_t)INFINITY, vcmpeqq(vecIn, (float16_t)0)); - /* - * restore sign - */ - r.f = vnegq_m(r.f, r.f, vcmpltq_n_f16(vecIn, (float16_t)0)); - - return r.f; -} - - - -__STATIC_FORCEINLINE float16x8_t vatan_f16( - float16x8_t x) -{ - float16x8_t a, b, r; - float16x8_t xx; - any16x8_t xinv , ax; - - ax.f = vabsq(x); - //fast inverse approximation (2x newton) - xinv.f = vrecip_lowprec_f16( ax.f ); - - //if |x| > 1.0 -> ax = -1/ax, r = pi/2 - xinv.f = xinv.f + ax.f; - - // a = (c > 1.0f); - a = vdupq_n_f16(0.0f16); - a = vdupq_m(a, 1.0f16, vcmpgtq(ax.f, 1.0f16)); - - ax.f = ax.f - a * xinv.f; - r = a * (float16_t)__PI_2_F16; - - //polynomial evaluation - xx = ax.f * ax.f; - a = (atanf_lut_f16[0] * ax.f) * xx + (atanf_lut_f16[2] * ax.f); - b = (atanf_lut_f16[1] * ax.f) * xx + (atanf_lut_f16[3] * ax.f); - xx = xx * xx; - b = b + a * xx; - r = r + b; - - //if x < 0 -> r = -r - r = vnegq_m(r, r, vcmpltq(x, 0.0f16)); - // set 'tiny' values to x (F16 precision limit) - r = vpselq(x, r, vcmpleq(vabsq(x), 0.05f16)); - - return r; -} - - -__STATIC_INLINE float16x8_t vdiv_f16( - float16x8_t num, float16x8_t den) -{ - return vmulq(num, vrecip_hiprec_f16(den)); -} - - - - -__STATIC_FORCEINLINE float16x8_t visqrtf_f16( - float16x8_t vecIn) -{ - int16x8_t vecNewtonInit = vdupq_n_s16(INVSQRT_MAGIC_F16); - float16x8_t vecOneHandHalf = vdupq_n_f16(1.5f16); - float16x8_t vecHalf; - int16x8_t vecTmpInt; - float16x8_t vecTmpFlt, vecTmpFlt1; - - - vecHalf = vmulq(vecIn, (float16_t) 0.5f16); - /* - * cast input float vector to integer and right shift by 1 - */ - vecTmpInt = vshrq((int16x8_t) vecIn, 1); - /* - * INVSQRT_MAGIC - ((vec_q16_t)vecIn >> 1) - */ - vecTmpInt = vsubq(vecNewtonInit, vecTmpInt); - - /* - *------------------------------ - * 1st iteration - *------------------------------ - * (1.5f-xhalf*x*x) - */ - vecTmpFlt1 = vmulq((float16x8_t) vecTmpInt, (float16x8_t) vecTmpInt); - vecTmpFlt1 = vmulq(vecTmpFlt1, vecHalf); - vecTmpFlt1 = vsubq(vecOneHandHalf, vecTmpFlt1); - /* - * x = x*(1.5f-xhalf*x*x); - */ - vecTmpFlt = vmulq((float16x8_t) vecTmpInt, vecTmpFlt1); - - /* - *------------------------------ - * 2nd iteration - *------------------------------ - */ - vecTmpFlt1 = vmulq(vecTmpFlt, vecTmpFlt); - vecTmpFlt1 = vmulq(vecTmpFlt1, vecHalf); - vecTmpFlt1 = vsubq(vecOneHandHalf, vecTmpFlt1); - vecTmpFlt = vmulq(vecTmpFlt, vecTmpFlt1); - - /* - * set negative values to nan - */ - vecTmpFlt = vdupq_m(vecTmpFlt, (float16_t) NAN, vcmpltq(vecIn, (float16_t) 0.0f16)); - vecTmpFlt = - vdupq_m(vecTmpFlt, (float16_t) INFINITY, vcmpeqq(vecIn, (float16_t) 0.0f16)); - - return vecTmpFlt; -} - - -__STATIC_FORCEINLINE float16x8_t vsqrtf_f16( - float16x8_t vecIn) -{ - float16x8_t vecDst; - - /* inverse square root unsing 2 newton iterations */ - vecDst = visqrtf_f16(vecIn); - vecDst = vdupq_m(vecDst, 0.0f, vcmpeqq(vecIn, 0.0f)); - vecDst = vecDst * vecIn; - return vecDst; -} - -#endif - -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -#ifdef __cplusplus -} -#endif - -#endif // (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEF) || defined(ARM_MATH_MVEI) - -#endif // __ARM_2D_MATH_HELIUM_H__ - diff --git a/package/Arm2D/Library/Include/__arm_2d_paving.h b/package/Arm2D/Library/Include/__arm_2d_paving.h deleted file mode 100644 index c2ca67c6d..000000000 --- a/package/Arm2D/Library/Include/__arm_2d_paving.h +++ /dev/null @@ -1,818 +0,0 @@ -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_paving.h - * Description: Provides definitions and code templates for generic paving - * - * $Date: 20. Jan 2021 - * $Revision: V 0.5.0 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -#ifndef __ARM_2D_PAVING_H__ -#define __ARM_2D_PAVING_H__ - -/*============================ INCLUDES ======================================*/ - -#include "arm_2d.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ - -#define SETUP_DIRECT_COPY_8(srcWidth) (void)srcWidth; -#define SETUP_DIRECT_COPY_16(srcWidth) (void)srcWidth; -#define SETUP_DIRECT_COPY_32(srcWidth) (void)srcWidth; - - -/* scalar copy w/o mirroring */ -#define LOAD_SRC_DIRECT_8(pSource, offset) *pSource++; -#define LOAD_SRC_DIRECT_16(pSource, offset) *pSource++; -#define LOAD_SRC_DIRECT_32(pSource, offset) *pSource++; - -#define LOAD_SRC_X_MIRROR_8(pSource, offset) pSource[offset]; offset -= 1; -#define LOAD_SRC_X_MIRROR_16(pSource, offset) pSource[offset]; offset -= 1; -#define LOAD_SRC_X_MIRROR_32(pSource, offset) pSource[offset]; offset -= 1; - -#define SETUP_MIRROR_COPY_8(srcWidth) uint32_t offset = srcWidth - 1; -#define SETUP_MIRROR_COPY_16(srcWidth) uint32_t offset = srcWidth - 1; -#define SETUP_MIRROR_COPY_32(srcWidth) uint32_t offset = srcWidth - 1; - - -#define INCR_Y_DIR 1 -#define DECR_Y_DIR -1 -#define BOTTOM_TO_TOP INCR_Y_DIR -#define TOP_TO_BOTTOM DECR_Y_DIR - -#ifndef PAVING_OP - #define PAVING_OP(__DES_ADDR, __SRC) \ - do { \ - *(__DES_ADDR) = (__SRC); \ - }while(0) -#endif - -#define PAVING_DIRECT_START_OFFS(strd, heig) 0 -#define PAVING_DIRECT_READ_DIR BOTTOM_TO_TOP -#define PAVING_DIRECT_SETUP_COPY(sz) ARM_CONNECT2(SETUP_DIRECT_COPY_,sz) -#define PAVING_DIRECT_LOAD_PATTERN(sz) ARM_CONNECT2(LOAD_SRC_DIRECT_,sz) - -#define PAVING_X_MIRROR_START_OFFS(strd, heig) PAVING_DIRECT_START_OFFS(strd, heig) -#define PAVING_X_MIRROR_READ_DIR PAVING_DIRECT_READ_DIR -#define PAVING_X_MIRROR_SETUP_COPY(sz) ARM_CONNECT2(SETUP_MIRROR_COPY_,sz) -#define PAVING_X_MIRROR_LOAD_PATTERN(sz) ARM_CONNECT2(LOAD_SRC_X_MIRROR_,sz) - -#define PAVING_Y_MIRROR_START_OFFS(strd, heig) (strd * (heig - 1)) -#define PAVING_Y_MIRROR_READ_DIR TOP_TO_BOTTOM -#define PAVING_Y_MIRROR_SETUP_COPY(sz) PAVING_DIRECT_SETUP_COPY(sz) -#define PAVING_Y_MIRROR_LOAD_PATTERN(sz) PAVING_DIRECT_LOAD_PATTERN(sz) - -#define PAVING_XY_MIRROR_START_OFFS(strd, heig) PAVING_Y_MIRROR_START_OFFS(strd, heig) -#define PAVING_XY_MIRROR_READ_DIR PAVING_Y_MIRROR_READ_DIR -#define PAVING_XY_MIRROR_SETUP_COPY(sz) PAVING_X_MIRROR_SETUP_COPY(sz) -#define PAVING_XY_MIRROR_LOAD_PATTERN(sz) PAVING_X_MIRROR_LOAD_PATTERN(sz) - - - -#define __ARM_2D_MEM_FILL_GENERIC( pSourceBase, \ - iSourceStride, \ - ptSourceSize, \ - pTargetBase, \ - iTargetStride, \ - ptTargetSize, \ - pPavFct, \ - ...) \ -{ \ - uint16_t targetIWidth = ptTargetSize->iWidth; \ - uint16_t sourceIWidth = ptSourceSize->iWidth; \ - uint16_t targetIHeight = ptTargetSize->iHeight; \ - uint16_t sourceIHeight = ptSourceSize->iHeight; \ - uint32_t tilePairRows = (targetIHeight / (2 * sourceIHeight)); \ - uint32_t tilePairCols = (targetIWidth / (2 * sourceIWidth)); \ - int32_t residueW = 0; \ - int32_t residueH = 0; \ - uint32_t targetOffsetRows = 0; \ - uint32_t targetOffsetCols = 0; \ - \ - \ - /* can we handle vertical pairs of image ? */ \ - if (tilePairRows >= 1) { \ - /* target row coordinate after paving */ \ - targetOffsetRows = tilePairRows * (2 * sourceIHeight); \ - residueW = targetIWidth; \ - \ - /* can we handle horizontal pairs of image ? */ \ - if (tilePairCols >= 1) { \ - /* target column coordinate after paving */ \ - targetOffsetCols = tilePairCols * (2 * sourceIWidth); \ - \ - /* run 2 x 2 image paving */ \ - /* \ - * +=======+=======+=======+=======+=======+=======++..... \ - * ||xxxxxx|xxxxxxx|| | || | || \ - * +-------+-------+-------+-------+-------+-------+-..... \ - * ||xxxxxx|xxxxxxx|| | || | || \ - * +=======+=======+=======+=======+=======+=======++..... \ - * || | || | || | || \ - * +-------+-------+-------+-------+-------+-------+-..... \ - * || | || | || | || \ - * +=======+=======+=======+=======+=======+=======++..... \ - */ \ - pPavFct->pav_2x2(pSourceBase, iSourceStride, ptSourceSize, \ - pTargetBase, iTargetStride, \ - tilePairRows, tilePairCols \ - ,##__VA_ARGS__); \ - \ - residueW = targetIWidth - targetOffsetCols; \ - } \ - \ - \ - if (residueW > ptSourceSize->iWidth) { \ - /* run 1 x 2 image paving */ \ - /* \ - * ...+=======+=..... \ - * ...||xxxxxx|| \ - * ...+-------+-..... \ - * ...||xxxxxx|| \ - * ...+=======+=..... \ - */ \ - pPavFct->pav_1x2( pSourceBase, \ - iSourceStride, \ - ptSourceSize, \ - pTargetBase + targetOffsetCols, \ - iTargetStride, \ - ptSourceSize->iWidth, \ - tilePairRows, ##__VA_ARGS__); \ - \ - targetOffsetCols += ptSourceSize->iWidth; \ - residueW = targetIWidth - targetOffsetCols; \ - } \ - if (residueW > 0) { \ - /* run residual 1 x 2 image paving */ \ - /* \ - * ...+===== \ - * ...||xxxx \ - * ...+----- \ - * ...||xxxx \ - * ...+===== \ - */ \ - pPavFct->pav_1x2( pSourceBase, iSourceStride, ptSourceSize, \ - pTargetBase + targetOffsetCols, \ - iTargetStride, residueW, tilePairRows \ - , ##__VA_ARGS__); \ - } \ - } \ - \ - \ - /* less than 2 complete vertical images */ \ - targetOffsetCols = 0; \ - residueH = targetIHeight - targetOffsetRows; \ - if (residueH >= ptSourceSize->iHeight) { \ - residueW = targetIWidth; \ - \ - /* can we handle horizontal pair of image ? */ \ - if (tilePairCols >= 1) { \ - /* run 2 x 1 image paving */ \ - /* \ - * +=======+=======+=======+=======+=======+=======++..... \ - * ||xxxxxx|xxxxxxx|| | || | || \ - * +-------+-------+-------+-------+-------+-------+-..... \ - * .................................................. \ - */ \ - pPavFct->pav_2x1( pSourceBase, \ - iSourceStride, \ - ptSourceSize, \ - pTargetBase + \ - targetOffsetRows * iTargetStride, \ - iTargetStride, \ - tilePairCols, \ - ptSourceSize->iHeight \ - , ##__VA_ARGS__); \ - \ - targetOffsetCols = tilePairCols * (2 * sourceIWidth); \ - residueW = targetIWidth - targetOffsetCols; \ - } \ - \ - if (residueW > ptSourceSize->iWidth) { \ - /* run single image paving */ \ - /* \ - * +=======+... \ - * ||xxxxx||... \ - * +-------+... \ - * ............ \ - */ \ - pPavFct->pav_1x1(pSourceBase, \ - iSourceStride, \ - pTargetBase + targetOffsetRows * iTargetStride + \ - targetOffsetCols, \ - iTargetStride, \ - ptSourceSize, \ - ptSourceSize \ - , ##__VA_ARGS__); \ - \ - targetOffsetCols += ptSourceSize->iWidth; \ - residueW = targetIWidth - targetOffsetCols; \ - } \ - \ - if (residueW > 0) { \ - /* run residual single image paving (complete height, */ \ - /* but truncated width) */ \ - /* */ \ - /* +=====... */ \ - /* ||xxxx... */ \ - /* +-----... */ \ - /* ......... */ \ - /* */ \ - arm_2d_size_t tail; \ - tail.iWidth = residueW; \ - tail.iHeight = ptSourceSize->iHeight; \ - \ - pPavFct->pav_1x1( pSourceBase, \ - iSourceStride, \ - pTargetBase + targetOffsetRows * iTargetStride +\ - targetOffsetCols, \ - iTargetStride, \ - ptSourceSize, \ - &tail \ - , ##__VA_ARGS__); \ - \ - } \ - targetOffsetRows += ptSourceSize->iHeight; \ - } \ - \ - /* less than 1 complete vertical images */ \ - targetOffsetCols = 0; \ - residueH = ptTargetSize->iHeight - targetOffsetRows; \ - if (residueH) { \ - arm_2d_size_t tail; \ - tail.iWidth = ptSourceSize->iWidth; \ - tail.iHeight = residueH; \ - \ - if (tilePairCols >= 1) { \ - /* run vertical truncated 2 x 1 image paving */ \ - /* \ - * +=======+=======+=======+=======+=======+=======++..... \ - * ||xxxxxx|xxxxxxx|| | || | || \ - * .................................................. \ - */ \ - pPavFct->pav_2x1( pSourceBase, \ - iSourceStride, \ - ptSourceSize, \ - pTargetBase + targetOffsetRows * iTargetStride, \ - iTargetStride, \ - tilePairCols, \ - residueH \ - , ##__VA_ARGS__); \ - \ - targetOffsetCols = tilePairCols * (2 * sourceIWidth); \ - } \ - \ - residueW = targetIWidth - targetOffsetCols; \ - if (residueW > ptSourceSize->iWidth) { \ - /* run vertical truncated single image copy */ \ - /* \ - * +=======+... \ - * ||xxxxx||... \ - * ............ \ - */ \ - \ - pPavFct->pav_1x1( pSourceBase, \ - iSourceStride, \ - pTargetBase + targetOffsetRows * iTargetStride +\ - targetOffsetCols, \ - iTargetStride, \ - ptSourceSize, \ - &tail \ - , ##__VA_ARGS__); \ - \ - targetOffsetCols += ptSourceSize->iWidth; \ - residueW = targetIWidth - targetOffsetCols; \ - } \ - \ - if (residueW > 0) { \ - /* run horizontal & vertical truncated single image copy */ \ - /* \ - * +======.. \ - * ||xxxxx... \ - * .......... \ - */ \ - tail.iWidth = residueW; \ - \ - pPavFct->pav_1x1( pSourceBase, \ - iSourceStride, \ - pTargetBase + targetOffsetRows * iTargetStride +\ - targetOffsetCols, \ - iTargetStride, \ - ptSourceSize, \ - &tail \ - , ##__VA_ARGS__); \ - } \ - } \ - \ -} - - - - -#define __ARM_2D_PAVING_2x2(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - uint32_t srcWidth = ptSourceSize->iWidth; \ - uint32_t srcHeight = ptSourceSize->iHeight; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pSourceBaseCur; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pTargetBaseCur = pTargetBase; \ - \ - \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - do { \ - uint32_t rowCnt = 0; \ - \ - pSourceBaseCur = (ARM_PIX_SCLTYP(sz) *)pSourceBase; \ - \ - /* single source row loop */ \ - do { \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst = pTargetBaseCur; \ - uint32_t tilePairColsCnt = tilePairCols; \ - \ - /* column loop */ \ - /* duplicate current source row into 2 x 2 destination across */ \ - /*destination columns */ \ - /* \ - * +-------+ \ - * |xxxxxxx| \ - * | src | \ - * +-------+ \ - * \ - * <---------------> \ - * \ - * || | || | || \ - * * +========+=======+========+=======+ \ - * | ||xxxxxxx|xxxxxxx||xxxxxxx|xxxxxxx||... \ - * | || | || | ||... \ - * | +--------+-------+--------+-------+-... \ - * | ||xxxxxxx|xxxxxxx||xxxxxxx|xxxxxxx||... \ - * | || | || | ||... \ - * * +========+=======+========+=======+ \ - * || | || | || \ - */ \ - do { \ - int32_t dstColCnt = srcWidth; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pSource = pSourceBaseCur + SRC_OFFSET; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst00 = pDst; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst01 = pDst00 + srcWidth; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst10 = pDst + srcHeight * iTargetStride; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst11 = pDst10 + srcWidth; \ - \ - SETUP_MIRROR(srcWidth); \ - \ - /* duplicate current source line into 2x2 destinations tiles*/ \ - do { \ - ARM_PIX_SCLTYP(sz) in; \ - \ - in = LOAD(pSource, offset); \ - if (true,##__VA_ARGS__) { \ - PAVING_OP(pDst00++, in); \ - PAVING_OP(pDst01++, in); \ - PAVING_OP(pDst10++, in); \ - PAVING_OP(pDst11++, in); \ - } else { \ - pDst00++;pDst01++;pDst10++;pDst11++; \ - } \ - \ - } while (--dstColCnt); \ - \ - pDst += 2 * srcWidth; \ - tilePairColsCnt--; \ - } \ - while (tilePairColsCnt != 0); \ - \ - rowCnt ++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < ptSourceSize->iHeight); \ - \ - pTargetBaseCur += srcHeight * iTargetStride; \ - tilePairRows--; \ - } \ - while (tilePairRows != 0); \ -} - -#define __ARM_2D_PAVING_1x2(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - uint32_t srcWidth = ptSourceSize->iWidth; \ - uint32_t srcHeight = ptSourceSize->iHeight; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pSourceBaseCur; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pTargetBaseCur = pTargetBase; \ - \ - \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - do { \ - uint32_t rowCnt = 0; \ - \ - pSourceBaseCur = (ARM_PIX_SCLTYP(sz) *)pSourceBase; \ - \ - /* single source row loop */ \ - do { \ - int32_t dstColCnt = destWidth; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pSource = pSourceBaseCur + SRC_OFFSET; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst = pTargetBaseCur; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst00 = pDst; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst10 = pDst + srcHeight * iTargetStride; \ - \ - /* column loop */ \ - /* duplicate current source row into 1 x 2 destination across */ \ - /* destination columns */ \ - /* \ - * +-------+ \ - * |xxxxxxx| \ - * | src | \ - * +-------+ \ - * \ - * ..|| || \ - * * ==+========+=... \ - * | ..||xxxxxxx||... \ - * | ..|| ||... \ - * | ..+--------+-... \ - * | ..||xxxxxxx||... \ - * | ..|| ||... \ - * * ==+========+=... \ - * ..|| ||... \ - */ \ - SETUP_MIRROR(srcWidth); \ - \ - /* duplicate current source line into 2x2 destinations */ \ - do { \ - ARM_PIX_SCLTYP(sz) in; \ - \ - in = LOAD(pSource, offset); \ - if (true,##__VA_ARGS__) { \ - PAVING_OP(pDst00++, in); \ - PAVING_OP(pDst10++, in); \ - } else { \ - pDst00 ++; \ - pDst10 ++; \ - } \ - } \ - while (--dstColCnt); \ - \ - rowCnt ++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < ptSourceSize->iHeight); \ - \ - pTargetBaseCur += srcHeight * iTargetStride; \ - tilePairRows--; \ - } \ - while (tilePairRows != 0); \ -} - - -#define __ARM_2D_PAVING_2x1(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - uint32_t srcWidth = ptSourceSize->iWidth; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pSourceBaseCur; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pTargetBaseCur = pTargetBase; \ - uint32_t rowCnt = 0; \ - \ - \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - /* \ - * +-------+ \ - * | src | \ - * +-------+ \ - * \ - * tilePairCols \ - * <---------------+--------........> \ - * \ - * +=======+=======++=======+=======++...... \ - * || | || | || \ - * +=======+=======++=======+=======++ \ - * ........ \ - */ \ - \ - pSourceBaseCur = (ARM_PIX_SCLTYP(sz) *)pSourceBase; \ - \ - /* copy 2 x 2 source image block */ \ - do { \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst = pTargetBaseCur; \ - ARM_PIX_SCLTYP(sz) tilePairColsCnt = tilePairCols; \ - \ - do { \ - int srcColCnt = srcWidth; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pSource = pSourceBaseCur+SRC_OFFSET; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst00 = pDst; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst01 = pDst00 + srcColCnt; \ - \ - SETUP_MIRROR(srcWidth); \ - \ - /* duplicate current source line into 4 destinations */ \ - do { \ - ARM_PIX_SCLTYP(sz) in; \ - \ - in = LOAD(pSource, offset); \ - if (true,##__VA_ARGS__) { \ - PAVING_OP(pDst00++, in); \ - PAVING_OP(pDst01++, in); \ - } else { \ - pDst00 ++; \ - pDst01 ++; \ - } \ - \ - srcColCnt -= 1; \ - } \ - while ((int32_t) srcColCnt > 0); \ - \ - pDst += 2 * srcWidth; \ - tilePairColsCnt--; \ - } \ - while (tilePairColsCnt != 0); \ - \ - rowCnt++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < destHeight); \ -} - - -#define __ARM_2D_PAVING_1x1(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - pSource += SRC_OFFSET; \ - \ - for (int_fast16_t y = 0; y < ptDstCopySize->iHeight; y++) { \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pDst = pTarget; \ - ARM_PIX_SCLTYP(sz) *__RESTRICT pSrc = (ARM_PIX_SCLTYP(sz) *)pSource; \ - uint32_t srcWidth = ptSrcCopySize->iWidth; \ - uint32_t dstWidth = ptDstCopySize->iWidth; \ - \ - SETUP_MIRROR(srcWidth); \ - \ - do { \ - ARM_PIX_SCLTYP(sz) in; \ - \ - in = LOAD(pSrc, offset); \ - if (true,##__VA_ARGS__) { \ - PAVING_OP(pDst++,in); \ - } else { \ - pDst++; \ - } \ - \ - dstWidth -= 1; \ - } \ - while ((int32_t) dstWidth > 0); \ - \ - pSource += (iSourceStride * DIR); \ - pTarget += iTargetStride; \ - } \ -} - - -/*============================ TYPES =========================================*/ - -typedef void (arm_2d_c8bit_paving_2x2) (const uint8_t *, int16_t, const arm_2d_size_t *, - uint8_t *, int16_t, uint16_t, uint16_t); - -typedef void (arm_2d_c8bit_paving_1x2) (const uint8_t *, int16_t, const arm_2d_size_t *, - uint8_t *, int16_t, uint32_t, uint16_t); - -typedef void (arm_2d_c8bit_paving_2x1) (const uint8_t *, int16_t, - const arm_2d_size_t *, uint8_t *, int16_t, uint16_t, uint16_t); - -typedef void (arm_2d_c8bit_paving_1x1) (const uint8_t *, int16_t, uint8_t *, int16_t, - const arm_2d_size_t *, const arm_2d_size_t *); - - -typedef struct arm_2d_c8bit_paving_fct_t { - arm_2d_c8bit_paving_2x2 *pav_2x2; - arm_2d_c8bit_paving_1x2 *pav_1x2; - arm_2d_c8bit_paving_2x1 *pav_2x1; - arm_2d_c8bit_paving_1x1 *pav_1x1; -} arm_2d_c8bit_paving_fct_t; - - -typedef void (arm_2d_rgb16_paving_2x2) (const uint16_t *, int16_t, const arm_2d_size_t *, - uint16_t *, int16_t, uint16_t, uint16_t); - -typedef void (arm_2d_rgb16_paving_1x2) (const uint16_t *, int16_t, const arm_2d_size_t *, - uint16_t *, int16_t, uint32_t, uint16_t); - -typedef void (arm_2d_rgb16_paving_2x1) (const uint16_t *, int16_t, - const arm_2d_size_t *, uint16_t *, int16_t, uint16_t, uint16_t); - -typedef void (arm_2d_rgb16_paving_1x1) (const uint16_t *, int16_t, uint16_t *, int16_t, - const arm_2d_size_t *, const arm_2d_size_t *); - - -typedef struct arm_2d_rgb16_paving_fct_t { - arm_2d_rgb16_paving_2x2 *pav_2x2; - arm_2d_rgb16_paving_1x2 *pav_1x2; - arm_2d_rgb16_paving_2x1 *pav_2x1; - arm_2d_rgb16_paving_1x1 *pav_1x1; -} arm_2d_rgb16_paving_fct_t; - -typedef void (arm_2d_rgb32_paving_2x2) (const uint32_t *, int16_t, const arm_2d_size_t *, - uint32_t *, int16_t, uint16_t, uint16_t); - -typedef void (arm_2d_rgb32_paving_1x2) (const uint32_t *, int16_t, const arm_2d_size_t *, - uint32_t *, int16_t, uint32_t, uint16_t); - -typedef void (arm_2d_rgb32_paving_2x1) (const uint32_t *, int16_t, - const arm_2d_size_t *, uint32_t *, int16_t, uint16_t, uint16_t); - -typedef void (arm_2d_rgb32_paving_1x1) (const uint32_t *, int16_t, uint32_t *, int16_t, - const arm_2d_size_t *, const arm_2d_size_t *); - - -typedef struct arm_2d_rgb32_paving_fct_t { - arm_2d_rgb32_paving_2x2 *pav_2x2; - arm_2d_rgb32_paving_1x2 *pav_1x2; - arm_2d_rgb32_paving_2x1 *pav_2x1; - arm_2d_rgb32_paving_1x1 *pav_1x1; -} arm_2d_rgb32_paving_fct_t; - - - -typedef void (arm_2d_c8bit_cl_key_paving_2x2)( const uint8_t * __RESTRICT, - int16_t, - const arm_2d_size_t * __RESTRICT, - uint8_t * __RESTRICT, - int16_t, - uint16_t, - uint16_t, - uint8_t); - -typedef void (arm_2d_c8bit_cl_key_paving_1x2) ( const uint8_t *__RESTRICT , - int16_t, - const arm_2d_size_t *__RESTRICT, - uint8_t *__RESTRICT, - int16_t, - uint32_t, - uint16_t, - uint8_t); - -typedef void (arm_2d_c8bit_cl_key_paving_2x1) ( const uint8_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - uint8_t *__RESTRICT, - int16_t, - uint16_t, - uint16_t, - uint8_t); - -typedef void (arm_2d_c8bit_cl_key_paving_1x1) ( const uint8_t *__RESTRICT, - int16_t, - uint8_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - const arm_2d_size_t *__RESTRICT, - uint8_t); - - -typedef struct arm_2d_c8bit_cl_key_paving_fct_t { - arm_2d_c8bit_cl_key_paving_2x2 *pav_2x2; - arm_2d_c8bit_cl_key_paving_1x2 *pav_1x2; - arm_2d_c8bit_cl_key_paving_2x1 *pav_2x1; - arm_2d_c8bit_cl_key_paving_1x1 *pav_1x1; -} arm_2d_c8bit_cl_key_paving_fct_t; - - -typedef void (arm_2d_rgb16_cl_key_paving_2x2)( const uint16_t * __RESTRICT, - int16_t, - const arm_2d_size_t * __RESTRICT, - uint16_t * __RESTRICT, - int16_t, - uint16_t, - uint16_t, - uint16_t); - -typedef void (arm_2d_rgb16_cl_key_paving_1x2) ( const uint16_t *__RESTRICT , - int16_t, - const arm_2d_size_t *__RESTRICT, - uint16_t *__RESTRICT, - int16_t, - uint32_t, - uint16_t, - uint16_t); - -typedef void (arm_2d_rgb16_cl_key_paving_2x1) ( const uint16_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - uint16_t *__RESTRICT, - int16_t, - uint16_t, - uint16_t, - uint16_t); - -typedef void (arm_2d_rgb16_cl_key_paving_1x1) ( const uint16_t *__RESTRICT, - int16_t, - uint16_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - const arm_2d_size_t *__RESTRICT, - uint16_t); - - -typedef struct arm_2d_rgb16_cl_key_paving_fct_t { - arm_2d_rgb16_cl_key_paving_2x2 *pav_2x2; - arm_2d_rgb16_cl_key_paving_1x2 *pav_1x2; - arm_2d_rgb16_cl_key_paving_2x1 *pav_2x1; - arm_2d_rgb16_cl_key_paving_1x1 *pav_1x1; -} arm_2d_rgb16_cl_key_paving_fct_t; - - - -typedef void (arm_2d_rgb32_cl_key_paving_2x2)( const uint32_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - uint32_t *__RESTRICT, - int16_t, - uint16_t, - uint16_t, - uint32_t); - -typedef void (arm_2d_rgb32_cl_key_paving_1x2) ( const uint32_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - uint32_t *__RESTRICT, - int16_t, - uint32_t, - uint16_t, - uint32_t); - -typedef void (arm_2d_rgb32_cl_key_paving_2x1) ( const uint32_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - uint32_t *__RESTRICT, - int16_t, - uint16_t, - uint16_t, - uint32_t); - -typedef void (arm_2d_rgb32_cl_key_paving_1x1) ( const uint32_t *__RESTRICT, - int16_t, - uint32_t *__RESTRICT, - int16_t, - const arm_2d_size_t *__RESTRICT, - const arm_2d_size_t *__RESTRICT, - uint32_t); - - -typedef struct arm_2d_rgb32_cl_key_paving_fct_t { - arm_2d_rgb32_cl_key_paving_2x2 *pav_2x2; - arm_2d_rgb32_cl_key_paving_1x2 *pav_1x2; - arm_2d_rgb32_cl_key_paving_2x1 *pav_2x1; - arm_2d_rgb32_cl_key_paving_1x1 *pav_1x1; -} arm_2d_rgb32_cl_key_paving_fct_t; - - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -#if defined(__clang__) -# pragma clang diagnostic pop -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic pop -#endif - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/__arm_2d_paving_helium.h b/package/Arm2D/Library/Include/__arm_2d_paving_helium.h deleted file mode 100644 index 3b89b7ddc..000000000 --- a/package/Arm2D/Library/Include/__arm_2d_paving_helium.h +++ /dev/null @@ -1,704 +0,0 @@ -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_paving_helium.h - * Description: Provides definitions and code templates for generic paving - * - * $Date: 17. Sep 2021 - * $Revision: V 0.6.0 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -#ifndef __ARM_2D_PAVING_HELIUM_H__ -#define __ARM_2D_PAVING_HELIUM_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d.h" -#include "__arm_2d_paving.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ - - -#undef LOAD_SRC_DIRECT_16 -#undef LOAD_SRC_DIRECT_32 -#undef LOAD_SRC_X_MIRROR_16 -#undef LOAD_SRC_X_MIRROR_32 -#undef SETUP_MIRROR_COPY_16 -#undef SETUP_MIRROR_COPY_32 -#undef __ARM_2D_PAVING_2x2 -#undef __ARM_2D_PAVING_1x2 -#undef __ARM_2D_PAVING_2x1 -#undef __ARM_2D_PAVING_1x1 - - - -/* Set predicate to true if vector different than color mask */ -#define CMP_CL_MSK(sz, colour) p = vcmpneq_m(in, colour, p) - - -#undef LOAD_SRC_DIRECT_8 -#undef LOAD_SRC_DIRECT_16 -#undef LOAD_SRC_DIRECT_32 -#undef LOAD_SRC_X_MIRROR_8 -#undef LOAD_SRC_X_MIRROR_16 -#undef LOAD_SRC_X_MIRROR_32 -#undef SETUP_MIRROR_COPY_8 -#undef SETUP_MIRROR_COPY_16 -#undef SETUP_MIRROR_COPY_32 - - -#define LOAD_SRC_DIRECT_8(pSource, offset) \ - vld1q_z(pSource, p); \ - pSource += 16; - -#define LOAD_SRC_DIRECT_16(pSource, offset) \ - vld1q_z(pSource, p); \ - pSource += 8; - -#define LOAD_SRC_DIRECT_32(pSource, offset) \ - vld1q_z(pSource, p); \ - pSource += 4; - -#define LOAD_SRC_X_MIRROR_8(pSource, offset) \ - vldrbq_gather_offset_z(pSource, offset, p); \ - offset = vddupq_x_wb_u8(&curOffsetIdx, 1, p); - -#define LOAD_SRC_X_MIRROR_16(pSource, offset) \ - vldrhq_gather_shifted_offset_z(pSource, offset, p); \ - offset = vddupq_x_wb_u16(&curOffsetIdx, 1, p); - -#define LOAD_SRC_X_MIRROR_32(pSource, offset) \ - vldrwq_gather_shifted_offset_z(pSource, offset, p); \ - offset = vddupq_x_wb_u32(&curOffsetIdx, 1, p); - -/* prepare Helium gather load offset */ -#define SETUP_MIRROR_COPY_8(srcWidth) \ - uint32_t curOffsetIdx = srcWidth - 1; \ - uint8x16_t offset = vddupq_wb_u8(&curOffsetIdx, 1); - -#define SETUP_MIRROR_COPY_16(srcWidth) \ - uint32_t curOffsetIdx = srcWidth - 1; \ - uint16x8_t offset = vddupq_wb_u16(&curOffsetIdx, 1); - -#define SETUP_MIRROR_COPY_32(srcWidth) \ - uint32_t curOffsetIdx = srcWidth - 1; \ - uint32x4_t offset = vddupq_wb_u32(&curOffsetIdx, 1); - - -/* Macros intercepting X or XY mirroring */ -#define IS_PAVING_DIRECT_LOAD_PATTERN(sz) (0) -#define IS_PAVING_X_MIRROR_LOAD_PATTERN(sz) ((sz == 8)? 1: 0) -#define IS_PAVING_Y_MIRROR_LOAD_PATTERN(sz) (0) -#define IS_PAVING_XY_MIRROR_LOAD_PATTERN(sz) ((sz == 8)? 1: 0) - - -/* handle c8bit X or XY 2x2 mirroring when tile width > 256 */ -/* uses 8-bit widened load allowing width up to 65K */ -#define __ARM_2D_PAVING_2x2_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, ...) \ -{ \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - do { \ - uint32_t rowCnt = 0; \ - \ - pSourceBaseCur = pSourceBase; \ - \ - /* single source row loop */ \ - do { \ - uint8_t *pDst = (uint8_t*)pTargetBaseCur; \ - uint32_t tilePairColsCnt = tilePairCols; \ - \ - /* column loop */ \ - /* duplicate current source row into 2 x 2 destination across */ \ - /*destination columns */ \ - /* \ - * +-------+ \ - * |xxxxxxx| \ - * | src | \ - * +-------+ \ - * \ - * <---------------> \ - * \ - * || | || | || \ - * * +========+=======+========+=======+ \ - * | ||xxxxxxx|xxxxxxx||xxxxxxx|xxxxxxx||... \ - * | || | || | ||... \ - * | +--------+-------+--------+-------+-... \ - * | ||xxxxxxx|xxxxxxx||xxxxxxx|xxxxxxx||... \ - * | || | || | ||... \ - * * +========+=======+========+=======+ \ - * || | || | || \ - */ \ - do { \ - int32_t dstColCnt = srcWidth; \ - const uint8_t *pSource = (const uint8_t*)pSourceBaseCur \ - + SRC_OFFSET; \ - uint8_t *pDst00 = (uint8_t*)pDst; \ - uint8_t *pDst01 = (uint8_t*)pDst00 + srcWidth; \ - uint8_t *pDst10 = (uint8_t*)pDst + srcHeight * \ - iTargetStride; \ - uint8_t *pDst11 = (uint8_t*)pDst10 + srcWidth; \ - \ - uint32_t curOffsetIdx = srcWidth - 1; \ - uint16x8_t offset = vddupq_wb_u16(&curOffsetIdx, 1); \ - \ - /* duplicate current source line into 2x2 destinations */ \ - do { \ - mve_pred16_t p = vctp16q(dstColCnt); \ - uint8x16_t in; \ - in = vldrbq_gather_offset_z_u16(pSource, offset, p); \ - offset = vddupq_x_wb_u16(&curOffsetIdx, 1, p); \ - \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vstrbq_p_u16(pDst00, in, p); \ - vstrbq_p_u16(pDst01, in, p); \ - vstrbq_p_u16(pDst10, in, p); \ - vstrbq_p_u16(pDst11, in, p); \ - \ - pDst00 += 8; \ - pDst01 += 8; \ - pDst10 += 8; \ - pDst11 += 8; \ - dstColCnt -= 8; \ - } \ - while (dstColCnt > 0); \ - \ - pDst += 2 * srcWidth; \ - tilePairColsCnt--; \ - } \ - while (tilePairColsCnt != 0); \ - \ - rowCnt ++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < ptSourceSize->iHeight); \ - \ - pTargetBaseCur += srcHeight * iTargetStride; \ - tilePairRows--; \ - } \ - while (tilePairRows != 0); \ -} - - - -#define __ARM_2D_PAVING_2x2(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - uint32_t srcWidth = ptSourceSize->iWidth; \ - uint32_t srcHeight = ptSourceSize->iHeight; \ - const ARM_PIX_SCLTYP(sz) *pSourceBaseCur; \ - ARM_PIX_SCLTYP(sz) *pTargetBaseCur = pTargetBase; \ - \ - if ((sz == 8) && (srcWidth >= 256) && IS_##LOAD) { \ - /* special case for 8-bit and X & XY mirror */ \ - /* width does not fit in 8-bit, need widening */ \ - /* will be optimized away for all other cases */ \ - /* not executed unconditionally as slower */ \ - __ARM_2D_PAVING_2x2_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, __VA_ARGS__) \ - } else \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - do { \ - uint32_t rowCnt = 0; \ - \ - pSourceBaseCur = pSourceBase; \ - \ - /* single source row loop */ \ - do { \ - ARM_PIX_SCLTYP(sz) *pDst = pTargetBaseCur; \ - uint32_t tilePairColsCnt = tilePairCols; \ - \ - /* column loop */ \ - /* duplicate current source row into 2 x 2 destination across */ \ - /*destination columns */ \ - /* \ - * +-------+ \ - * |xxxxxxx| \ - * | src | \ - * +-------+ \ - * \ - * <---------------> \ - * \ - * || | || | || \ - * * +========+=======+========+=======+ \ - * | ||xxxxxxx|xxxxxxx||xxxxxxx|xxxxxxx||... \ - * | || | || | ||... \ - * | +--------+-------+--------+-------+-... \ - * | ||xxxxxxx|xxxxxxx||xxxxxxx|xxxxxxx||... \ - * | || | || | ||... \ - * * +========+=======+========+=======+ \ - * || | || | || \ - */ \ - do { \ - int32_t dstColCnt = srcWidth; \ - const ARM_PIX_SCLTYP(sz) *pSource = pSourceBaseCur \ - + SRC_OFFSET; \ - ARM_PIX_SCLTYP(sz) *pDst00 = pDst; \ - ARM_PIX_SCLTYP(sz) *pDst01 = pDst00 + srcWidth; \ - ARM_PIX_SCLTYP(sz) *pDst10 = pDst + srcHeight * iTargetStride; \ - ARM_PIX_SCLTYP(sz) *pDst11 = pDst10 + srcWidth; \ - \ - SETUP_MIRROR(srcWidth); \ - \ - /* duplicate current source line into 2x2 destinations */ \ - do { \ - mve_pred16_t p = \ - ARM_CONNECT2(ARM_CONNECT2(vctp, sz),q)(dstColCnt); \ - ARM_PIX_VECTYP(sz) in; \ - \ - in = LOAD(pSource, offset); \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vst1q_p(pDst00, in, p); \ - vst1q_p(pDst01, in, p); \ - vst1q_p(pDst10, in, p); \ - vst1q_p(pDst11, in, p); \ - \ - pDst00 += ARM_PIX_VECELT(sz); \ - pDst01 += ARM_PIX_VECELT(sz); \ - pDst10 += ARM_PIX_VECELT(sz); \ - pDst11 += ARM_PIX_VECELT(sz); \ - dstColCnt -= ARM_PIX_VECELT(sz); \ - } \ - while (dstColCnt > 0); \ - \ - pDst += 2 * srcWidth; \ - tilePairColsCnt--; \ - } \ - while (tilePairColsCnt != 0); \ - \ - rowCnt ++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < ptSourceSize->iHeight); \ - \ - pTargetBaseCur += srcHeight * iTargetStride; \ - tilePairRows--; \ - } \ - while (tilePairRows != 0); \ -} - - -/* handle c8bit X or XY 1x2 mirroring when tile width > 256 */ -/* uses 8-bit widened load allowing width up to 65K */ -#define __ARM_2D_PAVING_1x2_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, ...) \ -{ \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - do { \ - uint32_t rowCnt = 0; \ - \ - pSourceBaseCur = pSourceBase; \ - \ - /* single source row loop */ \ - do { \ - int32_t dstColCnt = destWidth; \ - const uint8_t *pSource = (const uint8_t*)pSourceBaseCur \ - + SRC_OFFSET; \ - uint8_t *pDst = (uint8_t*)pTargetBaseCur; \ - uint8_t *pDst00 = pDst; \ - uint8_t *pDst10 = pDst + srcHeight * iTargetStride; \ - \ - /* column loop */ \ - /* duplicate current source row into 1 x 2 destination across */ \ - /* destination columns */ \ - /* \ - * +-------+ \ - * |xxxxxxx| \ - * | src | \ - * +-------+ \ - * \ - * ..|| || \ - * * ==+========+=... \ - * | ..||xxxxxxx||... \ - * | ..|| ||... \ - * | ..+--------+-... \ - * | ..||xxxxxxx||... \ - * | ..|| ||... \ - * * ==+========+=... \ - * ..|| ||... \ - */ \ - uint32_t curOffsetIdx = srcWidth - 1; \ - uint16x8_t offset = vddupq_wb_u16(&curOffsetIdx, 1); \ - \ - /* duplicate current source line into 2x2 destinations */ \ - do { \ - mve_pred16_t p = vctp16q(dstColCnt); \ - uint8x16_t in; \ - in = vldrbq_gather_offset_z_u16(pSource, offset, p); \ - offset = vddupq_x_wb_u16(&curOffsetIdx, 1, p); \ - \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vstrbq_p_u16(pDst00, in, p); \ - vstrbq_p_u16(pDst10, in, p); \ - \ - pDst00 += 8; \ - pDst10 += 8; \ - dstColCnt -= 8; \ - } \ - while (dstColCnt > 0); \ - \ - rowCnt ++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < ptSourceSize->iHeight); \ - \ - pTargetBaseCur += srcHeight * iTargetStride; \ - tilePairRows--; \ - } \ - while (tilePairRows != 0); \ -} - - -#define __ARM_2D_PAVING_1x2(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - uint32_t srcWidth = ptSourceSize->iWidth; \ - uint32_t srcHeight = ptSourceSize->iHeight; \ - const ARM_PIX_SCLTYP(sz) *pSourceBaseCur; \ - ARM_PIX_SCLTYP(sz) *pTargetBaseCur = pTargetBase; \ - \ - if ((sz == 8) && (srcWidth >= 256) && IS_##LOAD) { \ - /* special case for 8-bit and X & XY mirror */ \ - /* width does not fit in 8-bit, need widening */ \ - /* will be optimized away for all other cases */ \ - /* not executed unconditionally as slower */ \ - __ARM_2D_PAVING_1x2_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, __VA_ARGS__) \ - } else \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - do { \ - uint32_t rowCnt = 0; \ - \ - pSourceBaseCur = pSourceBase; \ - \ - /* single source row loop */ \ - do { \ - int32_t dstColCnt = destWidth; \ - const ARM_PIX_SCLTYP(sz) *pSource = pSourceBaseCur + SRC_OFFSET; \ - ARM_PIX_SCLTYP(sz) *pDst = pTargetBaseCur; \ - ARM_PIX_SCLTYP(sz) *pDst00 = pDst; \ - ARM_PIX_SCLTYP(sz) *pDst10 = pDst + srcHeight * iTargetStride; \ - \ - /* column loop */ \ - /* duplicate current source row into 1 x 2 destination across */ \ - /* destination columns */ \ - /* \ - * +-------+ \ - * |xxxxxxx| \ - * | src | \ - * +-------+ \ - * \ - * ..|| || \ - * * ==+========+=... \ - * | ..||xxxxxxx||... \ - * | ..|| ||... \ - * | ..+--------+-... \ - * | ..||xxxxxxx||... \ - * | ..|| ||... \ - * * ==+========+=... \ - * ..|| ||... \ - */ \ - SETUP_MIRROR(srcWidth); \ - \ - /* duplicate current source line into 2x2 destinations */ \ - do { \ - mve_pred16_t p = \ - ARM_CONNECT2(ARM_CONNECT2(vctp, sz),q)(dstColCnt); \ - ARM_PIX_VECTYP(sz) in; \ - \ - in = LOAD(pSource, offset); \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vst1q_p(pDst00, in, p); \ - vst1q_p(pDst10, in, p); \ - \ - pDst00 += ARM_PIX_VECELT(sz); \ - pDst10 += ARM_PIX_VECELT(sz); \ - dstColCnt -= ARM_PIX_VECELT(sz); \ - } \ - while (dstColCnt > 0); \ - \ - rowCnt ++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < ptSourceSize->iHeight); \ - \ - pTargetBaseCur += srcHeight * iTargetStride; \ - tilePairRows--; \ - } \ - while (tilePairRows != 0); \ -} - -/* handle c8bit X or XY 2x1 mirroring when tile width > 256 */ -/* uses 8-bit widened load allowing width up to 65K */ -#define __ARM_2D_PAVING_2x1_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, ...) \ -{ \ - \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - /* \ - * +-------+ \ - * | src | \ - * +-------+ \ - * \ - * tilePairCols \ - * <---------------+--------........> \ - * \ - * +=======+=======++=======+=======++...... \ - * || | || | || \ - * +=======+=======++=======+=======++ \ - * ........ \ - */ \ - \ - pSourceBaseCur = pSourceBase; \ - \ - /* copy 2 x 2 source image block */ \ - do { \ - uint8_t *pDst = (uint8_t*)pTargetBaseCur; \ - int16_t tilePairColsCnt = tilePairCols; \ - \ - do { \ - int srcColCnt = srcWidth; \ - const uint8_t *pSource = (const uint8_t*)pSourceBaseCur \ - + SRC_OFFSET; \ - uint8_t *pDst00 = pDst; \ - uint8_t *pDst01 = pDst00 + srcColCnt; \ - \ - uint32_t curOffsetIdx = srcWidth - 1; \ - uint16x8_t offset = vddupq_wb_u16(&curOffsetIdx, 1); \ - \ - /* duplicate current source line into 4 destinations */ \ - do { \ - mve_pred16_t p = vctp16q(srcColCnt); \ - uint8x16_t in; \ - in = vldrbq_gather_offset_z_u16(pSource, offset, p); \ - offset = vddupq_x_wb_u16(&curOffsetIdx, 1, p); \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vstrbq_p_u16(pDst00, in, p); \ - vstrbq_p_u16(pDst01, in, p); \ - \ - pDst00 += 8; \ - pDst01 += 8; \ - srcColCnt -= 8; \ - } \ - while ((int32_t) srcColCnt > 0); \ - \ - pDst += 2 * srcWidth; \ - tilePairColsCnt--; \ - } \ - while (tilePairColsCnt != 0); \ - \ - rowCnt++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < destHeight); \ -} - - -#define __ARM_2D_PAVING_2x1(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - uint32_t srcWidth = ptSourceSize->iWidth; \ - const ARM_PIX_SCLTYP(sz) *pSourceBaseCur; \ - ARM_PIX_SCLTYP(sz) *pTargetBaseCur = pTargetBase; \ - uint32_t rowCnt = 0; \ - \ - if ((sz == 8) && (srcWidth >= 256) && IS_##LOAD) { \ - /* special case for 8-bit and X & XY mirror */ \ - /* width does not fit in 8-bit, need widening */ \ - /* will be optimized away for all other cases */ \ - /* not executed unconditionally as slower */ \ - __ARM_2D_PAVING_2x1_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, __VA_ARGS__) \ - } else { \ - /* row iteration */ \ - /* handle pair of source image row and fill in the column direction */ \ - /* \ - * +-------+ \ - * | src | \ - * +-------+ \ - * \ - * tilePairCols \ - * <---------------+--------........> \ - * \ - * +=======+=======++=======+=======++...... \ - * || | || | || \ - * +=======+=======++=======+=======++ \ - * ........ \ - */ \ - \ - pSourceBaseCur = pSourceBase; \ - \ - /* copy 2 x 2 source image block */ \ - do { \ - ARM_PIX_SCLTYP(sz) *pDst = pTargetBaseCur; \ - ARM_PIX_SCLTYP(sz) tilePairColsCnt = tilePairCols; \ - \ - do { \ - int srcColCnt = srcWidth; \ - const ARM_PIX_SCLTYP(sz) *pSource = pSourceBaseCur + SRC_OFFSET; \ - ARM_PIX_SCLTYP(sz) *pDst00 = pDst; \ - ARM_PIX_SCLTYP(sz) *pDst01 = pDst00 + srcColCnt; \ - \ - SETUP_MIRROR(srcWidth); \ - \ - /* duplicate current source line into 4 destinations */ \ - do { \ - mve_pred16_t p = \ - ARM_CONNECT2(ARM_CONNECT2(vctp, sz),q)(srcColCnt); \ - ARM_PIX_VECTYP(sz) in; \ - \ - in = LOAD(pSource, offset); \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vst1q_p(pDst00, in, p); \ - vst1q_p(pDst01, in, p); \ - \ - pDst00 += ARM_PIX_VECELT(sz); \ - pDst01 += ARM_PIX_VECELT(sz); \ - srcColCnt -= ARM_PIX_VECELT(sz); \ - } \ - while ((int32_t) srcColCnt > 0); \ - \ - pDst += 2 * srcWidth; \ - tilePairColsCnt--; \ - } \ - while (tilePairColsCnt != 0); \ - \ - rowCnt++; \ - pTargetBaseCur += iTargetStride; \ - pSourceBaseCur += (iSourceStride * DIR); \ - } \ - while (rowCnt < destHeight); \ - } \ -} - - -/* handle c8bit X or XY 1x1 mirroring when tile width > 256 */ -/* uses 8-bit widened load allowing width up to 65K */ -#define __ARM_2D_PAVING_1x1_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, ...) \ -{ \ - pSource += SRC_OFFSET; \ - \ - for (int_fast16_t y = 0; y < ptDstCopySize->iHeight; y++) { \ - uint8_t *pDst = (uint8_t *)pTarget; \ - const uint8_t *pSrc = (const uint8_t*)pSource; \ - uint32_t dstWidth = ptDstCopySize->iWidth; \ - uint32_t curOffsetIdx = srcWidth - 1; \ - uint16x8_t offset = vddupq_wb_u16(&curOffsetIdx, 1); \ - \ - do { \ - mve_pred16_t p = vctp16q(dstWidth); \ - uint8x16_t in; \ - in = vldrbq_gather_offset_z_u16(pSrc, offset, p); \ - offset = vddupq_x_wb_u16(&curOffsetIdx, 1, p); \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vstrbq_p_u16(pDst, in, p); \ - \ - pDst += 8; \ - dstWidth -= 8; \ - } \ - while ((int32_t) dstWidth > 0); \ - \ - pSource += (iSourceStride * DIR); \ - pTarget += iTargetStride; \ - } \ -} - - -#define __ARM_2D_PAVING_1x1(sz, SRC_OFFSET, DIR, SETUP_MIRROR, LOAD, ...) \ -{ \ - uint32_t srcWidth = ptSrcCopySize->iWidth; \ - if ((sz == 8) && (srcWidth >= 256) && IS_##LOAD) { \ - /* special case for 8-bit and X & XY mirror */ \ - /* width does not fit in 8-bit, need widening */ \ - /* will be optimized away for all other cases */ \ - /* not executed unconditionally as slower */ \ - __ARM_2D_PAVING_1x1_8BIT_X_MIRROR_FIXUP(SRC_OFFSET, DIR, \ - SETUP_MIRROR, LOAD, __VA_ARGS__) \ - } else { \ - pSource += SRC_OFFSET; \ - \ - for (int_fast16_t y = 0; y < ptDstCopySize->iHeight; y++) { \ - ARM_PIX_SCLTYP(sz) *pDst = pTarget; \ - ARM_PIX_SCLTYP(sz) *pSrc = pSource; \ - uint32_t dstWidth = ptDstCopySize->iWidth; \ - \ - SETUP_MIRROR(srcWidth); \ - \ - do { \ - mve_pred16_t p = \ - ARM_CONNECT2(ARM_CONNECT2(vctp, sz), q) (dstWidth); \ - ARM_PIX_VECTYP(sz) in; \ - \ - in = LOAD(pSrc, offset); \ - /* placeholder for color masking */ \ - __VA_ARGS__; \ - \ - vst1q_p(pDst, in, p); \ - \ - pDst += ARM_PIX_VECELT(sz); \ - dstWidth -= ARM_PIX_VECELT(sz); \ - } \ - while ((int32_t) dstWidth > 0); \ - \ - pSource += (iSourceStride * DIR); \ - pTarget += iTargetStride; \ - } \ - } \ -} - -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/__arm_2d_utils_helium.h b/package/Arm2D/Library/Include/__arm_2d_utils_helium.h deleted file mode 100644 index 234cb3403..000000000 --- a/package/Arm2D/Library/Include/__arm_2d_utils_helium.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_utils_helium.h - * Description: Provides helium utility routines - * - * $Date: 20. May 2022 - * $Revision: V 0.0.2 - * - * Target Processor: Cortex-M cores with Helium - * - * -------------------------------------------------------------------- */ - - - -#ifndef __ARM_2D_UTILS_HELIUM_H__ -#define __ARM_2D_UTILS_HELIUM_H__ - - -#if __ARM_2D_HAS_HELIUM_INTEGER__ == 1 - -/*============================ INCLUDES ======================================*/ -#include "arm_2d.h" -#include - -#if defined(__ARM_2D_HAS_CDE__) && __ARM_2D_HAS_CDE__ -#include "__arm_2d_cde.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*============================ MACROS ========================================*/ - - -#if defined(__MVE_DEBUG__) && __MVE_DEBUG__ -# define ____MVE_WRAPPER(__FUNC) __FUNC##_mve -#else -# define ____MVE_WRAPPER(__FUNC) __FUNC -#endif - -#define __MVE_WRAPPER(__FUNC) ____MVE_WRAPPER(__FUNC) - - - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) -/* set vecAlpha value to 0 when equal to the compensated value */ -/* (=1 or 2 when involving 2 alpha = 255 multiplications) */ - -/* 16-bit vector */ -#define ALPHA_255_COMP_VEC16(vecAlpha, compVal) vecAlpha = \ - vpselq(vdupq_n_u16(256), vecAlpha, vcmpeqq_n_u16(vecAlpha, compVal)) - -/* 32-bit vector */ -#define ALPHA_255_COMP_VEC32(vecAlpha, compVal) vecAlpha = \ - vpselq(vdupq_n_u32(256), vecAlpha, vcmpeqq_n_u32(vecAlpha, compVal)) - -#else -#define ALPHA_255_COMP_VEC16(vecAlpha, compVal) -#define ALPHA_255_COMP_VEC32(vecAlpha, compVal) -#endif - - -/*============================ MACROFIED FUNCTIONS ===========================*/ - -__STATIC_FORCEINLINE -void __arm_2d_rgb565_unpack_single_vec(uint16x8_t in, - uint16x8_t * R, uint16x8_t * G, uint16x8_t * B) -{ - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - - *R = (in & vecMaskR) * 8; - *B = ((in >> 11)) * 8; - *G = ((in >> 5) & vecMaskG) * 4; -} - - -__STATIC_FORCEINLINE -uint16x8_t __arm_2d_rgb565_pack_single_vec(uint16x8_t R, uint16x8_t G, uint16x8_t B) -{ - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecMaskGpck = vdupq_n_u16(0x00fc); - - uint16x8_t vOut = vorrq(vshrq(R, 3), - vmulq(vandq(G, vecMaskGpck), 8)); - - vOut = vorrq(vOut, vmulq(vandq(B, vecMaskBpck), 256)); - - return vOut; -} - - -#if !defined(__ARM_2D_HAS_CDE__) || __ARM_2D_HAS_CDE__ == 0 - -__STATIC_FORCEINLINE -uint16x8_t __arm_2d_rgb565_blending_scal_opacity_single_vec( - uint16x8_t Source1, - uint16x8_t Source2, - uint_fast16_t hwRatio) -{ - /* scalar ratio allows extra optimization */ - uint16_t ratio1x8 = (256 - hwRatio) * 8; - uint16_t ratio1x4 = (256 - hwRatio) * 4; - uint16_t ratio2x8 = (hwRatio) * 8; - uint16_t ratio2x4 = (hwRatio) * 4; - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecMaskGpck = vdupq_n_u16(0x00fc); - uint16x8_t vecR0, vecB0, vecG0; - uint16x8_t vecR1, vecB1, vecG1; - - /* unpack 1st stream */ - vecR0 = Source1 & vecMaskR; - vecB0 = Source1 >> 11; - vecG0 = Source1 >> 5; - vecG0 = vecG0 & vecMaskG; - - - /* unpack 2nd stream */ - vecR1 = Source2 & vecMaskR; - vecB1 = Source2 >> 11; - vecG1 = Source2 >> 5; - vecG1 = vecG1 & vecMaskG; - - - /* merge */ - vecR0 = vecR0 * ratio1x8 + vecR1 * ratio2x8; - vecR0 = vecR0 >> 8; - - vecG0 = vecG0 * ratio1x4 + vecG1 * ratio2x4; - vecG0 = vecG0 >> 8; - - vecB0 = vecB0 * ratio1x8 + vecB1 * ratio2x8; - vecB0 = vecB0 >> 8; - - - /* pack */ - return vecR0 >> 3 | vmulq((vecG0 & vecMaskGpck), 8) - | vmulq((vecB0 & vecMaskBpck), 256); -} - - - - -__STATIC_FORCEINLINE -uint16x8_t __arm_2d_rgb565_blending_opacity_single_vec( - uint16x8_t Source1, - uint16x8_t Source2, - uint16x8_t vecHwOpacity) -{ - uint16x8_t vecAlpha = vsubq(vdupq_n_u16(256), vecHwOpacity); - uint16x8_t vecR, vecG, vecB; - uint16x8_t vecSrcR, vecSrcG, vecSrcB; - - /* unpack sources */ - __arm_2d_rgb565_unpack_single_vec(Source1, &vecR, &vecG, &vecB); - __arm_2d_rgb565_unpack_single_vec(Source2, &vecSrcR, &vecSrcG, &vecSrcB); - - /* merge */ - vecR = vecR * vecHwOpacity + vecSrcR * vecAlpha; - vecR = vecR >> 8; - - vecG = vecG * vecHwOpacity + vecSrcG * vecAlpha; - vecG = vecG >> 8; - - vecB = vecB * vecHwOpacity + vecSrcB * vecAlpha; - vecB = vecB >> 8; - - /* pack */ - return __arm_2d_rgb565_pack_single_vec(vecR, vecG, vecB); -} - -#endif - - -__STATIC_FORCEINLINE -uint16x8_t __arm_2d_gray8_blending_opacity_single_vec( - uint16x8_t Source1, - uint16x8_t Source2, - uint16x8_t vecHwOpacity) -{ - uint16x8_t vecAlpha = vsubq(vdupq_n_u16(256), vecHwOpacity); - - return vaddq( - vmulq(Source1, vecHwOpacity), - vmulq(Source2, vecAlpha)) >> 8; -} - - - -__STATIC_FORCEINLINE -uint32x4_t __arm_2d_cccn888_blending_opacity_single_vec_alt( - uint32x4_t Source1, - uint32x4_t Source2, - uint32x4_t vecHwOpacity) -{ - uint32x4_t vecAlpha = vsubq(vdupq_n_u32(256), vecHwOpacity); - uint32x4_t acc; - - acc = ((Source1 & 0xff) * vecHwOpacity + (Source2 & 0xff) * vecAlpha) >> 8; - acc |= - ((((Source1 >> 8) & 0xff) * vecHwOpacity + - ((Source2 >> 8) & 0xff) * vecAlpha) >> 8) << 8; - acc |= - ((((Source1 >> 16) & 0xff) * vecHwOpacity + - ((Source2 >> 16) & 0xff) * vecAlpha) >> 8) << 16; - /* preserve Source1 alpha */ - acc |= Source1 & 0xff000000; - - return acc; -} - - - -__STATIC_FORCEINLINE -uint32x4_t __arm_2d_cccn888_blending_opacity_single_vec( - uint32x4_t Source1, - uint32x4_t Source2, - uint32x4_t vecHwOpacity) -{ - uint32x4_t vecAlpha = vsubq(vdupq_n_u32(256), vecHwOpacity); - - /* expand opacity / alpha from byte to packed 32-bit*/ - /* {0x000000a0 0x000000a1 0x000000a2 0x000000a3} - => {0x00a0a0a0 0x00a1a1a1 0x00a2a2a2 0x00a3a3a3} - */ - uint32x4_t vecAlphaExp = (vecAlpha & 0xff) * 0x00010101; - uint32x4_t vecHwOpacityExp = (vecHwOpacity & 0xff) * 0x00010101; - - - uint32x4_t blendB = vaddq_u16(vmullbq_int_u8((uint8x16_t) Source1, - (uint8x16_t) vecHwOpacityExp), - vmullbq_int_u8((uint8x16_t) Source2, - (uint8x16_t) vecAlphaExp)); - uint32x4_t blendT = vaddq_u16(vmulltq_int_u8((uint8x16_t) Source1, - (uint8x16_t) vecHwOpacityExp), - vmulltq_int_u8((uint8x16_t) Source2, - (uint8x16_t) vecAlphaExp)); - - int8x16_t target = vshrnbq_n_s16(vuninitializedq_u8(), blendB, 8); - target = vshrntq_n_s16(target, blendT, 8); - - target = vpselq_u32(Source1, target, vcmpeqq_n_u32(vecHwOpacity, 0x100)); - target = vpselq_u32(Source2, target, vcmpeqq_n_u32(vecHwOpacity, 0)); - - /* preserve Source1 alpha */ - target = (int8x16_t) ((Source1 & 0xff000000) | ((uint32x4_t) target & 0x00ffffff)); - return target; -} - -__STATIC_FORCEINLINE -uint16x8_t __rgb888_alpha_blending_direct_single_vec( - uint16x8_t wSource1, /* widened input bytes */ - uint16x8_t wSource2, /* widened input bytes */ - uint_fast16_t hwRatio) -{ - uint16_t transp = 256 - (uint16_t) hwRatio; - uint16x8_t vecOut; - - vecOut = vmulq_n_u16(wSource1, (uint16_t) hwRatio); - vecOut = vmlaq_n_u16(vecOut, wSource2, transp); - - /* widened output */ - return vecOut >> 8; -} - - - -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -#ifdef __cplusplus -} -#endif - -#endif // (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEF) || defined(ARM_MATH_MVEI) - -#endif // __ARM_2D_UTILS_HELIUM_H__ - diff --git a/package/Arm2D/Library/Include/arm_2d.h b/package/Arm2D/Library/Include/arm_2d.h deleted file mode 100644 index 75fff3d4e..000000000 --- a/package/Arm2D/Library/Include/arm_2d.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d.h" - * Description: Public header file to contain the all avaialble Arm-2D - * interface header files - * - * $Date: 05. Sept 2022 - * $Revision: V.1.0.7 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_H__ -#define __ARM_2D_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d_types.h" -#include "arm_2d_op.h" -#include "arm_2d_tile.h" -#include "arm_2d_draw.h" -#include "arm_2d_conversion.h" -#include "arm_2d_alpha_blending.h" -#include "arm_2d_transform.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* suppress some warnings for user applications when using arm-2d. - */ -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 1296,174 -#endif - -/*! - * \addtogroup gKernel 1 Kernel - * @{ - */ - -/*============================ MACROS ========================================*/ - -/* arm-2d version */ -#define ARM_2D_VERSION_MAJOR 1 //!< Major version -#define ARM_2D_VERSION_MINOR 1 //!< Minor version -#define ARM_2D_VERSION_PATCH 0 //!< Patch number -#define ARM_2D_VERSION_STR "preview1" //!< tag - -/*! - * \brief arm-2d version number in decimal - * - */ -#define ARM_2D_VERISON ( ARM_2D_VERSION_MAJOR * 10000ul \ - + ARM_2D_VERSION_MINOR * 100ul \ - ARM_2D_VERSION_PATCH) - -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ - -/*! - * \brief a type for arm-2d runtime configuration - * - */ -typedef struct { - /*! if the target region is out of the target tile, return arm_fsm_rt_cpl */ - uint8_t TREAT_OUT_OF_RANGE_AS_COMPLETE : 1; - - /*! indicate that there is a dedicated thread to run arm_2d_task() in RTOS env */ - uint8_t HAS_DEDICATED_THREAD_FOR_2D_TASK : 1; - uint8_t : 6; -} arm_2d_runtime_feature_t; - -/*! - * \brief a type for arm-2d version - * - */ -typedef struct { - uint8_t Major; //!< major version - uint8_t Minor; //!< minor version - uint8_t Patch; //!< patch number - uint8_t : 8; -} arm_2d_version_t; - -/*============================ GLOBAL VARIABLES ==============================*/ - -/*! - * \brief arm-2d runtime feature configuration - * - */ -extern -arm_2d_runtime_feature_t ARM_2D_RUNTIME_FEATURE; - -/*! - * \brief arm-2d version - * - */ -extern -const arm_2d_version_t ARM_2D_VERSION; - -/*============================ PROTOTYPES ====================================*/ - -/*! - * \brief initialise arm-2d - */ -extern -void arm_2d_init(void); - -/*! - * \brief set the default frame buffer - * \param ptFrameBuffer the new frame buffer, - * \note Passing NULL means using no default framebuffer - * \return arm_2d_tile_t* the address of the old frame buffer - */ -extern -arm_2d_tile_t *arm_2d_set_default_frame_buffer( - const arm_2d_tile_t *ptFrameBuffer); - -/*! - * \brief get the default frame buffer - * \return arm_2d_tile_t* the address of the default frame buffer - */ -extern -arm_2d_tile_t *arm_2d_get_default_frame_buffer(void); - -/*! - * \brief attach a user param (which could be a pointer) to specified OP - * - * \param ptOP the address of the target OP (NULL means using the default OP) - * - * \param pUserParam a user parameter (it can be used as a pointer) - */ -extern -void arm_2d_set_user_param(arm_2d_op_core_t *ptOP, uintptr_t pUserParam); - -/*! - * \brief wait asynchronous operation complete - * \param[in] ptOP the address of the target OP (NULL means using the default OP) - * \retval true sync up with operation - * \retval false operation is busy - */ -extern -bool arm_2d_op_wait_async(arm_2d_op_core_t *ptOP); - -/*! - \brief get the status of a specified OP, - \details usually, it is used after calling arm_2d_op_wait_async(). - E.g. - \code - //! wait for previous operation complete - do { - arm_2d_op_wait_async(); - arm_2d_op_status_t tStatus = arm_2d_get_op_status(); - if (tStatus.bIOError) { - //! error detected - ... - } else if (tStatus.bOpCpl) { - break; - } - } while(true); - \endcode - \param ptOP the address of the target OP (NULL means using the default OP) - \return arm_2d_op_status_t the operation status - */ -extern -arm_2d_op_status_t arm_2d_get_op_status(arm_2d_op_core_t *ptOP); - -/*! - * \brief arm-2d pixel pipeline task entery - * \note This function is *TRHEAD-SAFE* - * \param ptTask the address of an arm-2d task control block - * \retval arm_fsm_rt_cpl The sub-task FIFO is empty, the caller can wait for a - * semaphore set by arm_2d_notif_sub_task_fifo_task_arrive() - * \retval arm_fsm_rt_on_going The arm_2d_task yields - * \retval arm_fsm_rt_async You shouldn't see this value - * \retval arm_fsm_rt_wait_for_obj hardware accelerator wants to sync-up with applications. - * \retval (<0) Serious error is detected. - */ -extern -arm_fsm_rt_t arm_2d_task(arm_2d_task_t *ptTask); - -/*! @} */ - -/*! \note delibrately comment out */ -//#if defined(__clang__) -//# pragma clang diagnostic pop -//#endif - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_alpha_blending.h b/package/Arm2D/Library/Include/arm_2d_alpha_blending.h deleted file mode 100644 index 595fd3890..000000000 --- a/package/Arm2D/Library/Include/arm_2d_alpha_blending.h +++ /dev/null @@ -1,1136 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d.h" - * Description: Public header file to contain the alpha-blending related - * APIs - * - * $Date: 17. June 2022 - * $Revision: V.1.0.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_ALPHA_BLENDING_H__ -#define __ARM_2D_ALPHA_BLENDING_H__ - -/*============================ INCLUDES ======================================*/ - -#include "arm_2d_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wmissing-declarations" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wc11-extensions" -#endif - -/*============================ MACROS ========================================*/ - -/*! - * \addtogroup Deprecated - * @{ - */ -#define arm_2d_rgb565_fill_colour_with_alpha \ - arm_2d_rgb565_fill_colour_with_opacity - -#define arm_2d_rgb888_fill_colour_with_alpha \ - arm_2d_rgb888_fill_colour_with_opacity - -#define arm_2d_cccn888_fill_colour_with_alpha \ - arm_2d_cccn888_fill_colour_with_opacity - -#define arm_2d_gray8_fill_colour_with_alpha_mask \ - arm_2d_gray8_fill_colour_with_mask - -#define arm_2d_rgb565_fill_colour_with_alpha_mask \ - arm_2d_rgb565_fill_colour_with_mask - -#define arm_2d_rgb888_fill_colour_with_alpha_mask \ - arm_2d_rgb888_fill_colour_with_mask - -#define arm_2d_cccn888_fill_colour_with_alpha_mask \ - arm_2d_cccn888_fill_colour_with_mask - -#define arm_2d_gray8_fill_colour_with_alpha_mask_and_opacity \ - arm_2d_gray8_fill_colour_with_mask_and_opacity - -#define arm_2d_rgb565_fill_colour_with_alpha_mask_and_opacity \ - arm_2d_rgb565_fill_colour_with_mask_and_opacity - -#define arm_2d_rgb888_fill_colour_with_alpha_mask_and_opacity \ - arm_2d_rgb888_fill_colour_with_mask_and_opacity - -#define arm_2d_cccn888_fill_colour_with_alpha_mask_and_opacity \ - arm_2d_cccn888_fill_colour_with_mask_and_opacity - -#define arm_2d_gray8_alpha_blending_with_colour_masking \ - arm_2d_gray8_alpha_blending_with_colour_keying - -#define arm_2d_rgb565_alpha_blending_with_colour_masking \ - arm_2d_rgb565_alpha_blending_with_colour_keying - -#define arm_2d_rgb888_alpha_blending_with_colour_masking \ - arm_2d_rgb888_alpha_blending_with_colour_keying - -#define arm_2d_cccn888_alpha_blending_with_colour_masking \ - arm_2d_cccn888_alpha_blending_with_colour_keying - -#define arm_2d_gray8_tile_copy_with_alpha_masks \ - arm_2d_gray8_tile_copy_with_masks - -#define arm_2d_rgb565_tile_copy_with_alpha_masks \ - arm_2d_rgb565_tile_copy_with_masks - -#define arm_2d_cccn888_tile_copy_with_alpha_masks \ - arm_2d_cccn888_tile_copy_with_masks - -#define arm_2d_rgb888_tile_copy_with_alpha_mask \ - arm_2d_rgb888_tile_copy_with_masks - -/*! @} */ - -/*! - * \addtogroup gAlpha 4 Alpha Blending Operations - * @{ - */ - -/*============================ MACROFIED FUNCTIONS ===========================*/ - -#define arm_2d_gray8_alpha_blending( __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA) /* alpha */ \ - arm_2dp_gray8_alpha_blending( NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA)) - -#define arm_2d_rgb565_alpha_blending( __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA) /* alpha */ \ - arm_2dp_rgb565_alpha_blending( NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA)) - -#define arm_2d_rgb888_alpha_blending( __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA) /* alpha */ \ - arm_2dp_cccn888_alpha_blending( NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA)) - -#define arm_2d_cccn888_alpha_blending( __SRC_ADDR, /* source tile address */\ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA) /* alpha */ \ - arm_2dp_cccn888_alpha_blending( NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA)) - -#define arm_2d_gray8_fill_colour_with_opacity( \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __COLOUR, /* colour */ \ - __ALPHA) /* alpha */ \ - arm_2dp_gray8_fill_colour_with_opacity( NULL, \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__COLOUR), \ - (__ALPHA)) - -#define arm_2d_rgb565_fill_colour_with_opacity( \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __COLOUR, /* colour */ \ - __ALPHA) /* alpha */ \ - arm_2dp_rgb565_fill_colour_with_opacity( NULL, \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__COLOUR), \ - (__ALPHA)) - -#define arm_2d_rgb888_fill_colour_with_opacity( \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __COLOUR, /* colour */ \ - __ALPHA) /* alpha */ \ - arm_2dp_cccn888_fill_colour_with_opacity( NULL, \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (arm_2d_color_cccn888_t){(__COLOUR).tValue}, \ - (__ALPHA)) - - -#define arm_2d_cccn888_fill_colour_with_opacity( \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __COLOUR, /* colour */ \ - __ALPHA) /* alpha */ \ - arm_2dp_cccn888_fill_colour_with_opacity( NULL, \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__COLOUR), \ - (__ALPHA)) - -#define arm_2d_gray8_fill_colour_with_mask( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR) /* colour */ \ - arm_2dp_gray8_fill_colour_with_mask( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (__COLOUR)) - -#define arm_2d_rgb565_fill_colour_with_mask( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR) /* colour */ \ - arm_2dp_rgb565_fill_colour_with_mask( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (__COLOUR)) - -#define arm_2d_rgb888_fill_colour_with_mask( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR) /* colour */ \ - arm_2dp_cccn888_fill_colour_with_mask( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (arm_2d_color_cccn888_t){(__COLOUR).tValue}) - -#define arm_2d_cccn888_fill_colour_with_mask( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR) /* colour */ \ - arm_2dp_cccn888_fill_colour_with_mask( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (__COLOUR)) - -#define arm_2d_gray8_fill_colour_with_mask_and_opacity( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR, /* colour */ \ - __OPACITY) \ - arm_2dp_gray8_fill_colour_with_mask_and_opacity( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (__COLOUR), \ - (__OPACITY)) - -#define arm_2d_rgb565_fill_colour_with_mask_and_opacity( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR, /* colour */ \ - __OPACITY) \ - arm_2dp_rgb565_fill_colour_with_mask_and_opacity( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (__COLOUR), \ - (__OPACITY)) - -#define arm_2d_rgb888_fill_colour_with_mask_and_opacity( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR, /* colour */ \ - __OPACITY) \ - arm_2dp_cccn888_fill_colour_with_mask_and_opacity( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (arm_2d_color_cccn888_t){(__COLOUR).tValue}, \ - (__OPACITY)) - -#define arm_2d_cccn888_fill_colour_with_mask_and_opacity( \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/\ - __ALPHA_ADDR, /* alpha tile address */ \ - __COLOUR, /* colour */ \ - __OPACITY) \ - arm_2dp_cccn888_fill_colour_with_mask_and_opacity( \ - NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA_ADDR), \ - (__COLOUR), \ - (__OPACITY)) - -#define arm_2d_gray8_alpha_blending_with_colour_keying( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA, /* colour */ \ - __COLOUR) /* alpha */ \ - arm_2dp_gray8_alpha_blending_with_colour_keying( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA), \ - (__COLOUR)) - -#define arm_2d_rgb565_alpha_blending_with_colour_keying( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA, /* colour */ \ - __COLOUR) /* alpha */ \ - arm_2dp_rgb565_alpha_blending_with_colour_keying( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA), \ - (__COLOUR)) - -#define arm_2d_rgb888_alpha_blending_with_colour_keying( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA, /* colour */ \ - __COLOUR) /* alpha */ \ - arm_2dp_cccn888_alpha_blending_with_colour_keying( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA), \ - (arm_2d_color_cccn888_t){(__COLOUR).tValue}) - -#define arm_2d_cccn888_alpha_blending_with_colour_keying( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION_ADDR,/* region address */ \ - __ALPHA, /* colour */ \ - __COLOUR) /* alpha */ \ - arm_2dp_cccn888_alpha_blending_with_colour_keying( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__REGION_ADDR), \ - (__ALPHA), \ - (__COLOUR)) - -#define arm_2d_gray8_tile_copy_with_masks( \ - __SRC_ADDR, /* source tile address */ \ - __SRC_MSK_ADDR, /* source mask address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_MSK_ADDR, /* target mask address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_gray8_tile_copy_with_masks( \ - NULL, \ - (__SRC_ADDR), \ - (__SRC_MSK_ADDR), \ - (__DES_ADDR), \ - (__DES_MSK_ADDR), \ - (__REGION), \ - (__MODE)) - -#define arm_2d_rgb565_tile_copy_with_masks( \ - __SRC_ADDR, /* source tile address */ \ - __SRC_MSK_ADDR, /* source mask address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_MSK_ADDR, /* target mask address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_rgb565_tile_copy_with_masks( \ - NULL, \ - (__SRC_ADDR), \ - (__SRC_MSK_ADDR), \ - (__DES_ADDR), \ - (__DES_MSK_ADDR), \ - (__REGION), \ - (__MODE)) - -#define arm_2d_rgb888_tile_copy_with_masks \ - arm_2d_cccn888_tile_copy_with_masks - -#define arm_2d_cccn888_tile_copy_with_masks( \ - __SRC_ADDR, /* source tile address */ \ - __SRC_MSK_ADDR, /* source mask address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_MSK_ADDR, /* target mask address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_cccn888_tile_copy_with_masks( \ - NULL, \ - (__SRC_ADDR), \ - (__SRC_MSK_ADDR), \ - (__DES_ADDR), \ - (__DES_MSK_ADDR), \ - (__REGION), \ - (__MODE)) - -#define arm_2d_gray8_tile_copy_with_src_mask( \ - __SRC_ADDR, /* source tile address */ \ - __SRC_MSK_ADDR, /* source mask address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_gray8_tile_copy_with_src_mask( \ - NULL, \ - (__SRC_ADDR), \ - (__SRC_MSK_ADDR), \ - (__DES_ADDR), \ - (__REGION), \ - (__MODE)) - - -#define arm_2d_rgb565_tile_copy_with_src_mask( \ - __SRC_ADDR, /* source tile address */ \ - __SRC_MSK_ADDR, /* source mask address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_rgb565_tile_copy_with_src_mask( \ - NULL, \ - (__SRC_ADDR), \ - (__SRC_MSK_ADDR), \ - (__DES_ADDR), \ - (__REGION), \ - (__MODE)) - - -#define arm_2d_rgb888_tile_copy_with_src_mask \ - arm_2d_cccn888_tile_copy_with_src_mask - -#define arm_2d_cccn888_tile_copy_with_src_mask( \ - __SRC_ADDR, /* source tile address */ \ - __SRC_MSK_ADDR, /* source mask address */ \ - __DES_ADDR, /* target tile address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_cccn888_tile_copy_with_src_mask( \ - NULL, \ - (__SRC_ADDR), \ - (__SRC_MSK_ADDR), \ - (__DES_ADDR), \ - (__REGION), \ - (__MODE)) - -#define arm_2d_gray8_tile_copy_with_des_mask( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_MSK_ADDR, /* target mask address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_gray8_tile_copy_with_des_mask( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_MSK_ADDR), \ - (__REGION), \ - (__MODE)) - - -#define arm_2d_rgb565_tile_copy_with_des_mask( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_MSK_ADDR, /* target mask address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_rgb565_tile_copy_with_des_mask( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_MSK_ADDR), \ - (__REGION), \ - (__MODE)) - -#define arm_2d_rgb888_tile_copy_with_des_mask \ - arm_2d_cccn888_tile_copy_with_des_mask - -#define arm_2d_cccn888_tile_copy_with_des_mask( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_MSK_ADDR, /* target mask address */ \ - __REGION, /* region address */ \ - __MODE) /* copy mode */ \ - arm_2dp_cccn888_tile_copy_with_des_mask( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_MSK_ADDR), \ - (__REGION), \ - (__MODE)) - -/*============================ TYPES =========================================*/ - -/*! - * \brief control block for alpha-blending operations - * \note arm_2d_op_alpha_t inherits from arm_2d_op_src_t explicitly - */ -typedef struct arm_2d_op_alpha_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; //!< target - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; //!< source - uint32_t wMode; //!< copy mode - uint8_t chRatio; //!< opacity -} arm_2d_op_alpha_t; - - -/*! - * \brief control block for alpha-blending-with-colour-keying operations - * \note arm_2d_op_alpha_cl_key_t inherits from arm_2d_op_src_t explicitly - */ -typedef struct arm_2d_op_alpha_cl_key_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; //!< target - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; //!< source - uint32_t wMode; //!< copy mode - uint8_t chRatio; //!< opacity - - union { - uint8_t chColour; //!< 8bit key colour - uint16_t hwColour; //!< 16bit key colour - uint32_t wColour; //!< 32bit key colour - }; -} arm_2d_op_alpha_cl_key_t; - - -/*! - * \brief control block for colour-filling-with-mask operations - * \note arm_2d_op_fill_cl_msk_t inherits from arm_2d_op_src_t explicitly - */ -typedef struct arm_2d_op_fill_cl_msk_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; //!< target - struct { - const arm_2d_tile_t *ptTile; //!< Alpha Mask tile - } Mask; //!< mask - uint32_t wMode; //!< copy mode - - union { - uint8_t chColour; //!< 8bit key colour - uint16_t hwColour; //!< 16bit key colour - uint32_t wColour; //!< 32bit key colour - }; -} arm_2d_op_fill_cl_msk_t; - - -/*! - * \brief control block for colour-filling-with-mask-and-opacity operations - * \note arm_2d_op_fill_cl_msk_t inherits from arm_2d_op_src_t explicitly - */ -typedef struct arm_2d_op_alpha_fill_cl_msk_opc_t { - inherit(arm_2d_op_core_t); //!< core - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; //!< target - struct { - const arm_2d_tile_t *ptTile; //!< Alpha Mask tile - } Mask; //!< mask - uint32_t wMode; //!< copy mode - union { - uint8_t chColour; //!< 8bit key colour - uint16_t hwColour; //!< 16bit key colour - uint32_t wColour; //!< 32bit key colour - }; - uint8_t chRatio; //!< opacity -} arm_2d_op_alpha_fill_cl_msk_opc_t; - -/*! - * \brief control block for colour-filling-with-opacity operations - * \note arm_2d_op_fill_cl_t inherits from arm_2d_op_t explicitly - */ -typedef struct arm_2d_op_fill_cl_opc_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; //!< target - union { - uint8_t chColour; //!< 8bit key colour - uint16_t hwColour; //!< 16bit key colour - uint32_t wColour; //!< 32bit key colour - }; - uint8_t chRatio; //!< opacity -} arm_2d_op_fill_cl_opc_t; - -/*! - * \brief control block for copy with masks operations - * - */ -typedef arm_2d_op_src_msk_t arm_2d_op_cp_msk_t; - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*----------------------------------------------------------------------------* - * Copy tile to destination with specified transparency ratio (0~255) * - *----------------------------------------------------------------------------*/ - -/*! - * \brief blend a source tile to a target tile with a specified opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chRatio the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_gray8_alpha_blending( arm_2d_op_alpha_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio); - -/*! - * \brief blend a source tile to a target tile with a specified opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chRatio the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb565_alpha_blending( arm_2d_op_alpha_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio); - -/*! - * \brief blend a source tile to a target tile with a specified opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chRatio the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_cccn888_alpha_blending( arm_2d_op_alpha_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio); - - -/*----------------------------------------------------------------------------* - * Fill a specified region with a given colour and transparency ratio (0~255) * - *----------------------------------------------------------------------------*/ - -/*! - * \brief fill a target tile with a given gray8 colour and a specified opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] tColour a gray8 colour - * \param[in] chRatio the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_gray8_fill_colour_with_opacity( - arm_2d_op_fill_cl_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - arm_2d_color_gray8_t tColour, - uint_fast8_t chRatio); - -/*! - * \brief fill a target tile with a given rgb565 colour and a specified opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] tColour a rgb565 colour - * \param[in] chRatio the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb565_fill_colour_with_opacity( - arm_2d_op_fill_cl_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - arm_2d_color_rgb565_t tColour, - uint_fast8_t chRatio); - -/*! - * \brief fill a target tile with a given cccn888 colour and a specified opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] tColour a cccn888 colour - * \param[in] chRatio the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_cccn888_fill_colour_with_opacity( - arm_2d_op_fill_cl_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - arm_2d_color_cccn888_t tColour, - uint_fast8_t chRatio); - -/*----------------------------------------------------------------------------* - * Fill tile with a specified colour and an alpha mask * - *----------------------------------------------------------------------------*/ - -/*! - * \brief fill a target tile with a given gray8 colour and a mask on target side - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] ptAlpha the mask on the target side - * \param[in] tColour a gray8 colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_gray8_fill_colour_with_mask( - arm_2d_op_fill_cl_msk_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_gray8_t tColour); - -/*! - * \brief fill a target tile with a given rgb565 colour and a mask on target side - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] ptAlpha the mask on the target side - * \param[in] tColour a rgb565 colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_rgb565_fill_colour_with_mask( - arm_2d_op_fill_cl_msk_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_rgb565_t tColour); - -/*! - * \brief fill a target tile with a given cccn888 colour and a mask on target side - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] ptAlpha the mask on the target side - * \param[in] tColour a cccn888 colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_cccn888_fill_colour_with_mask( - arm_2d_op_fill_cl_msk_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_cccn888_t tColour); - -/*----------------------------------------------------------------------------* - * Fill tile with a specified colour, an alpha mask and a specified opacity * - *----------------------------------------------------------------------------*/ - -/*! - * \brief fill a target tile with a given gray8 colour, a mask on target side and an opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] ptAlpha the mask on the target side - * \param[in] tColour a gray8 colour - * \param[in] chOpacity the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_gray8_fill_colour_with_mask_and_opacity( - arm_2d_op_alpha_fill_cl_msk_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_gray8_t tColour, - uint8_t chOpacity); - -/*! - * \brief fill a target tile with a given rgb565 colour, a mask on target side and an opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] ptAlpha the mask on the target side - * \param[in] tColour a rgb565 colour - * \param[in] chOpacity the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_rgb565_fill_colour_with_mask_and_opacity( - arm_2d_op_alpha_fill_cl_msk_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_rgb565_t tColour, - uint8_t chOpacity); - -/*! - * \brief fill a target tile with a given cccn888 colour, a mask on target side and an opacity - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] ptAlpha the mask on the target side - * \param[in] tColour a cccn888 colour - * \param[in] chOpacity the opacity - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_cccn888_fill_colour_with_mask_and_opacity( - arm_2d_op_alpha_fill_cl_msk_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_cccn888_t tColour, - uint8_t chOpacity); - -/*----------------------------------------------------------------------------* - * Blend tile and background with a specified transparency ratio(0~255) and a * - * specified transparency color mask * - *----------------------------------------------------------------------------*/ - -/*! - * \brief blend a source tile to a target tile with a opacity and colour keying - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chRatio the opacity - * \param[in] tColour the key colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_gray8_alpha_blending_with_colour_keying( - arm_2d_op_alpha_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio, - arm_2d_color_gray8_t tColour); - -/*! - * \brief blend a source tile to a target tile with a opacity and colour keying - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chRatio the opacity - * \param[in] tColour the key colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb565_alpha_blending_with_colour_keying( - arm_2d_op_alpha_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio, - arm_2d_color_rgb565_t tColour); - -/*! - * \brief blend a source tile to a target tile with a opacity and colour keying - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chRatio the opacity - * \param[in] tColour the key colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_cccn888_alpha_blending_with_colour_keying( - arm_2d_op_alpha_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio, - arm_2d_color_cccn888_t tColour); - -/*----------------------------------------------------------------------------* - * Copy tile to destination with both a source mask and a target mask * - *----------------------------------------------------------------------------*/ - -/*! - * \brief copy a source tile to a target tile with masks in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSrcMask the mask on the source side - * \param[in] ptTarget the target tile - * \param[in] ptDesMask the mask on the target side - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4,5) -arm_fsm_rt_t arm_2dp_gray8_tile_copy_with_masks( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief copy a source tile to a target tile with masks in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSrcMask the mask on the source side - * \param[in] ptTarget the target tile - * \param[in] ptDesMask the mask on the target side - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4,5) -arm_fsm_rt_t arm_2dp_rgb565_tile_copy_with_masks( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief copy a source tile to a target tile with masks in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSrcMask the mask on the source side - * \param[in] ptTarget the target tile - * \param[in] ptDesMask the mask on the target side - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4,5) -arm_fsm_rt_t arm_2dp_cccn888_tile_copy_with_masks( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*----------------------------------------------------------------------------* - * Copy tile to destination with a specified source mask * - *----------------------------------------------------------------------------*/ -/*! - * \brief copy a source tile to a target tile with a source mask in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSrcMask the mask on the source side - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_gray8_tile_copy_with_src_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief copy a source tile to a target tile with a source mask in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSrcMask the mask on the source side - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_rgb565_tile_copy_with_src_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief copy a source tile to a target tile with a source mask in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSrcMask the mask on the source side - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_cccn888_tile_copy_with_src_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*----------------------------------------------------------------------------* - * Copy tile to destination with a specified target mask * - *----------------------------------------------------------------------------*/ - -/*! - * \brief copy a source tile to a target tile with a target mask in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptDesMask the mask on the target side - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_gray8_tile_copy_with_des_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief copy a source tile to a target tile with a target mask in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptDesMask the mask on the target side - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_rgb565_tile_copy_with_des_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief copy a source tile to a target tile with a target mask in a given mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptDesMask the mask on the target side - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_cccn888_tile_copy_with_des_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! @} */ - -#if defined(__clang__) -#pragma clang diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_conversion.h b/package/Arm2D/Library/Include/arm_2d_conversion.h deleted file mode 100644 index 9c78a9be6..000000000 --- a/package/Arm2D/Library/Include/arm_2d_conversion.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d.h" - * Description: Public header file to contain the APIs for colour space - * conversions - * - * $Date: 09. Aug 2022 - * $Revision: V.1.0.3 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_CONVERSION_H__ -#define __ARM_2D_CONVERSION_H__ - -/*============================ INCLUDES ======================================*/ - -#include "arm_2d_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wnarrowing" -#elif defined(__IS_COMPILER_IAR__) -# pragma diag_suppress=Go029 -#endif - -/*! - * \addtogroup gConversion 6 Conversion Operations - * @{ - */ - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ - -#define arm_2d_convert_colour_to_rgb888(__SRC_ADDR, /* source tile address */ \ - __DES_ADDR /* target tile address */) \ - arm_2dp_convert_colour_to_rgb888( NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR)) - -#define arm_2d_convert_colour_to_rgb565(__SRC_ADDR, /* source tile address */ \ - __DES_ADDR /* target tile address */) \ - arm_2dp_convert_colour_to_rgb565( NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR)) - -/*============================ TYPES =========================================*/ - -typedef arm_2d_op_src_t arm_2d_op_cl_convt_t; - -/*! \brief 3x16-bit packed RGB color - * autovectorizer friendly format - */ -typedef union { - uint16_t BGRA[4]; - struct { - uint16_t B; - uint16_t G; - uint16_t R; - uint16_t A; - }; -} __arm_2d_color_fast_rgb_t; - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*----------------------------------------------------------------------------* - * RGB565 channels extraction/packing * - *----------------------------------------------------------------------------*/ - -/*! - * \brief unpack a rgb565 colour into a given __arm_2d_color_fast_rgb_t object - * \param[in] hwColour the target rgb565 colour - * \param[out] ptRGB a __arm_2d_color_fast_rgb_t object - */ -ARM_NONNULL(2) -__STATIC_INLINE void __arm_2d_rgb565_unpack(uint16_t hwColor, - __arm_2d_color_fast_rgb_t * ptRGB) -{ - assert(NULL != ptRGB); - - /* uses explicit extraction, leading to a more efficient autovectorized code */ - uint16_t maskRunpk = 0x001f, maskGunpk = 0x003f; - - ptRGB->B = (uint16_t) ((hwColor & maskRunpk) << 3); - ptRGB->R = (uint16_t) ((hwColor >> 11) << 3); - ptRGB->G = (uint16_t) (((hwColor >> 5) & maskGunpk) << 2); - - ptRGB->A = 0xFF; -} - -/*! - * \brief generate a rgb565 colour from a __arm_2d_color_fast_rgb_t object - * \param[in] ptRGB the target __arm_2d_color_fast_rgb_t object - * \return uint16_t a rgb565 colour - */ -ARM_NONNULL(1) -__STATIC_INLINE uint16_t __arm_2d_rgb565_pack(__arm_2d_color_fast_rgb_t * ptRGB) -{ - assert(NULL != ptRGB); - - arm_2d_color_rgb565_t tOutput = { - .u5R = (uint16_t) ptRGB->R >> 3, - .u6G = (uint16_t) ptRGB->G >> 2, - .u5B = (uint16_t) ptRGB->B >> 3, - }; - return tOutput.tValue; -} - -/*! - * \brief generate a cccn888 colour from a __arm_2d_color_fast_rgb_t object - * \param[in] ptRGB the target __arm_2d_color_fast_rgb_t object - * \return uint32_t a cccn888 colour - * \note the alpha channel will be kept in the output value - */ -ARM_NONNULL(1) -__STATIC_INLINE uint32_t __arm_2d_cccn888_pack(__arm_2d_color_fast_rgb_t * ptRGB) -{ - assert(NULL != ptRGB); - - arm_2d_color_bgra8888_t tOutput = { - .u8R = (uint16_t) ptRGB->R, - .u8G = (uint16_t) ptRGB->G, - .u8B = (uint16_t) ptRGB->B, - .u8A = (uint16_t) ptRGB->A, - }; - return tOutput.tValue; -} - - -/*----------------------------------------------------------------------------* - * Colour Conversion * - *----------------------------------------------------------------------------*/ - -/*! - * \brief convert the colour format of a given tile to gray8 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[out] ptTarget the output tile (holding a buffer) - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_convert_colour_to_gray8( arm_2d_op_cl_convt_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget); - -/*! - * \brief convert the colour format of a given tile to rgb888 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[out] ptTarget the output tile (holding a buffer) - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_convert_colour_to_rgb888( arm_2d_op_cl_convt_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget); -/*! - * \brief convert the colour format of a given tile to rgb565 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[out] ptTarget the output tile (holding a buffer) - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_convert_colour_to_rgb565( arm_2d_op_cl_convt_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget); - -/*! @} */ - -#if defined(__clang__) -# pragma clang diagnostic pop -#elif defined(__IS_COMPILER_IAR__) -# pragma diag_warning=Go029 -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_draw.h b/package/Arm2D/Library/Include/arm_2d_draw.h deleted file mode 100644 index 057214466..000000000 --- a/package/Arm2D/Library/Include/arm_2d_draw.h +++ /dev/null @@ -1,501 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d.h" - * Description: Public header file to contain the APIs for colour space - * conversions - * - * $Date: 17. June 2022 - * $Revision: V.1.0.2 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_DRAW_H__ -#define __ARM_2D_DRAW_H__ - -/*============================ INCLUDES ======================================*/ - -#include "arm_2d_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -# pragma clang diagnostic ignored "-Wsign-conversion" -#endif - -/*! - * \addtogroup Drawing 3 Drawing Operations - * @{ - */ - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ - -#define arm_2d_c8bit_draw_point(__TARGET_ADDR, /* target tile address */ \ - __LOCATION, /* point coordinate */ \ - __COLOUR) /* target colour */ \ - arm_2dp_c8bit_draw_point(NULL, \ - (__TARGET_ADDR), \ - (__LOCATION), \ - (__COLOUR)) - -#define arm_2d_rgb16_draw_point(__TARGET_ADDR, /* target tile address */ \ - __LOCATION, /* point coordinate */ \ - __COLOUR) /* target colour */ \ - arm_2dp_rgb16_draw_point(NULL, \ - (__TARGET_ADDR), \ - (__LOCATION), \ - (__COLOUR)) - -#define arm_2d_rgb32_draw_point(__TARGET_ADDR, /* target tile address */ \ - __LOCATION, /* point coordinate */ \ - __COLOUR) /* target colour */ \ - arm_2dp_rgb32_draw_point(NULL, \ - (__TARGET_ADDR), \ - (__LOCATION), \ - (__COLOUR)) - - -#define arm_2d_c8bit_draw_pattern( __PATTERN_ADDR, /* pattern tile address */ \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/ \ - __MODE, /* draw mode */ \ - __FG_COLOUR, /* foreground colour */ \ - __BG_COLOUR) /* background colour */ \ - arm_2dp_c8bit_draw_pattern(NULL, \ - (__PATTERN_ADDR), \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__MODE), \ - (__FG_COLOUR), \ - (__BG_COLOUR)) - -#define arm_2d_rgb16_draw_pattern( __PATTERN_ADDR, /* pattern tile address */ \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/ \ - __MODE, /* draw mode */ \ - __FG_COLOUR, /* foreground colour */ \ - __BG_COLOUR) /* background colour */ \ - arm_2dp_rgb16_draw_pattern(NULL, \ - (__PATTERN_ADDR), \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__MODE), \ - (__FG_COLOUR), \ - (__BG_COLOUR)) - -#define arm_2d_rgb32_draw_pattern( __PATTERN_ADDR, /* pattern tile address */ \ - __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/ \ - __MODE, /* draw mode */ \ - __FG_COLOUR, /* foreground colour */ \ - __BG_COLOUR) /* background colour */ \ - arm_2dp_rgb32_draw_pattern(NULL, \ - (__PATTERN_ADDR), \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__MODE), \ - (__FG_COLOUR), \ - (__BG_COLOUR)) - -#define arm_2d_c8bit_fill_colour( __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/ \ - __COLOUR) /* colour */ \ - arm_2dp_c8bit_fill_colour(NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__COLOUR)) - -#define arm_2d_rgb16_fill_colour( __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/ \ - __COLOUR) /* colour */ \ - arm_2dp_rgb16_fill_colour(NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__COLOUR)) - -#define arm_2d_rgb32_fill_colour( __TARGET_ADDR, /* target tile address*/ \ - __REGION_ADDR, /* target region address*/ \ - __COLOUR) /* colour */ \ - arm_2dp_rgb32_fill_colour(NULL, \ - (__TARGET_ADDR), \ - (__REGION_ADDR), \ - (__COLOUR)) - -/*============================ TYPES =========================================*/ - -/*! - * \brief the control block for colour-filling-operations - * \note arm_2d_op_fill_cl_t inherits from arm_2d_op_t explicitly - */ -typedef struct arm_2d_op_fill_cl_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - union { - uint8_t chColour; //!< 8bit colour - uint16_t hwColour; //!< 16bit colour - uint32_t wColour; //!< 32bit colour - }; -} arm_2d_op_fill_cl_t; - -/*! \note arm_2d_op_fill_cl_t inherits from arm_2d_op_t explicitly - */ -typedef arm_2d_op_fill_cl_t arm_2d_op_drw_pt_t; - -/*! - * \brief the control block for draw-bit-pattern operations - * \note arm_2d_op_drw_patn_t inherits from arm_2d_op_src_t explicitly - */ -typedef struct arm_2d_op_drw_patn_t { - inherit(arm_2d_op_core_t); //!< base - - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; //!< mode of the operation - union { - uint8_t chColour; //!< 8bit colour - uint16_t hwColour; //!< 16bit colour - uint32_t wColour; //!< 32bit colour - }Foreground; //!< forground colour - union { - uint8_t chColour; //!< 8bit colour - uint16_t hwColour; //!< 16bit colour - uint32_t wColour; //!< 32bit colour - }Background; //!< background colour - -} arm_2d_op_drw_patn_t; - - -/*! - * \brief modes for copying bit-patterns - */ -enum { - ARM_2D_DRW_PATN_MODE_COPY = 0, //!< copy bit pattern - //ARM_2D_DRW_PATN_MODE_FILL = _BV(0), //!< not support yet - //ARM_2D_DRW_PATN_MODE_Y_MIRROR = _BV(2), //!< not support yet - //ARM_2D_DRW_PATN_MODE_X_MIRROR = _BV(3), //!< not support yet - ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR = _BV(4), //!< use user specified backgound colour - ARM_2D_DRW_PATN_MODE_NO_FG_COLOR = _BV(5), //!< no forground - - /*! use complementary colour as foreground colour - * - * \note this option is only avaialble when ARM_2D_DRW_PATN_MODE_NO_FG_COLOR - * is used together. - */ - ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR = _BV(6), -}; - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*----------------------------------------------------------------------------* - * Draw a point with specified colour * - *----------------------------------------------------------------------------*/ - -/*! - * \brief draw a point on a root tile with a given 8bit colour - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \note the point must be inside the region of the target tile - * \param[in] chColour an 8bit colour - */ -ARM_NONNULL(1) -__STATIC_INLINE void arm_2d_c8bit_draw_point_fast( const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint_fast8_t chColour) -{ - assert(NULL != ptTarget); - assert(ptTarget->bIsRoot); // must be root tile - assert(tLocation.iX < ptTarget->tRegion.tSize.iWidth); - assert(tLocation.iY < ptTarget->tRegion.tSize.iHeight); - - uint8_t *pchPoint = ptTarget->pchBuffer - + tLocation.iY * ptTarget->tRegion.tSize.iWidth - + tLocation.iX; - *pchPoint = (uint8_t)chColour; -} - -/*! - * \brief draw a point on a root tile with a given 16bit colour - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \note the point must be inside the region of the target tile - * \param[in] hwColour an 16bit colour - */ -ARM_NONNULL(1) -__STATIC_INLINE void arm_2d_rgb16_draw_point_fast( - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint_fast16_t hwColour) -{ - assert(NULL != ptTarget); - assert(ptTarget->bIsRoot); // must be root tile - assert(tLocation.iX < ptTarget->tRegion.tSize.iWidth); - assert(tLocation.iY < ptTarget->tRegion.tSize.iHeight); - - uint16_t *phwPoint = ptTarget->phwBuffer - + tLocation.iY * ptTarget->tRegion.tSize.iWidth - + tLocation.iX; - *phwPoint = (uint16_t)hwColour; -} - -/*! - * \brief draw a point on a root tile with a given 32bit colour - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \note the point must be inside the region of the target tile - * \param[in] wColour an 32bit colour - */ -ARM_NONNULL(1) -__STATIC_INLINE void arm_2d_rgb32_draw_point_fast( - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint32_t wColour) -{ - assert(NULL != ptTarget); - assert(ptTarget->bIsRoot); // must be root tile - assert(tLocation.iX < ptTarget->tRegion.tSize.iWidth); - assert(tLocation.iY < ptTarget->tRegion.tSize.iHeight); - - uint32_t *pwPoint = ptTarget->pwBuffer - + tLocation.iY * ptTarget->tRegion.tSize.iWidth - + tLocation.iX; - *pwPoint = wColour; -} - -/*! - * \brief draw a point with a given 8bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \param[in] chColour an 8bit colour - * \return arm_fsm_rt_t the operation result - * - * \note As those draw point APIs involve the region calculation - * which is only useful when partial framebuffer is used, it is slow. - * For gettting better performance, if the target tile is root and the - * target location is inside the target region, please use the - * functions with "_fast" posfix. - * - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_c8bit_draw_point( arm_2d_op_drw_pt_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint_fast8_t chColour); - -/*! - * \brief draw a point with a given 16bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \param[in] hwColour an 16bit colour - * \return arm_fsm_rt_t the operation result - * - * \note As those draw point APIs involve the region calculation - * which is only useful when partial framebuffer is used, it is slow. - * For gettting better performance, if the target tile is root and the - * target location is inside the target region, please use the - * functions with "_fast" posfix. - * - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb16_draw_point( arm_2d_op_drw_pt_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint_fast16_t hwColour); - -/*! - * \brief draw a point with a given 32bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \param[in] wColour an 32bit colour - * \return arm_fsm_rt_t the operation result - * - * \note As those draw point APIs involve the region calculation - * which is only useful when partial framebuffer is used, it is slow. - * For gettting better performance, if the target tile is root and the - * target location is inside the target region, please use the - * functions with "_fast" posfix. - * - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb32_draw_point( arm_2d_op_drw_pt_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint32_t wColour); - - -#if 0 // todo: draw point with alpha -extern -ARM_NONNULL(1) -arm_fsm_rt_t arm_2d_rgba8888_draw_point(const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - arm_2d_color_bgra8888_t tColour); -#endif - - -/*----------------------------------------------------------------------------* - * Draw a bit patterns * - *----------------------------------------------------------------------------*/ - -/*! - * \brief copy a bit-pattern with given 8bit colours - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptPattern the source bit pattern - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \param[in] chForeColour the foreground colour - * \param[in] chBackColour the background colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_draw_pattern( arm_2d_op_drw_patn_t *ptOP, - const arm_2d_tile_t *ptPattern, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode, - uint8_t chForeColour, - uint8_t chBackColour); - -/*! - * \brief copy a bit-pattern with given 16bit colours - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptPattern the source bit pattern - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \param[in] hwForeColour the foreground colour - * \param[in] hwBackColour the background colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_draw_pattern( arm_2d_op_drw_patn_t *ptOP, - const arm_2d_tile_t *ptPattern, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode, - uint16_t hwForeColour, - uint16_t hwBackColour); - -/*! - * \brief copy a bit-pattern with given 32bit colours - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptPattern the source bit pattern - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \param[in] wForeColour the foreground colour - * \param[in] wBackColour the background colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_draw_pattern( arm_2d_op_drw_patn_t *ptOP, - const arm_2d_tile_t *ptPattern, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode, - uint32_t wForeColour, - uint32_t wBackColour); - -/*----------------------------------------------------------------------------* - * Fill tile with a specified colour * - *----------------------------------------------------------------------------*/ - -/*! - * \brief fill the target region with a given 8bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chColour a 8bit colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_c8bit_fill_colour( arm_2d_op_fill_cl_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chColour); - -/*! - * \brief fill the target region with a given 16bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] hwColour a 16bit colour - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb16_fill_colour( arm_2d_op_fill_cl_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast16_t hwColour); - -/*! - * \brief fill the target region with a given 32bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wColour a 32bit colour - * \return arm_fsm_rt_t the operations result - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb32_fill_colour( arm_2d_op_fill_cl_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wColour); - - -/*! @} */ - -#if defined(__clang__) -# pragma clang diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_features.h b/package/Arm2D/Library/Include/arm_2d_features.h deleted file mode 100644 index 8e224d18b..000000000 --- a/package/Arm2D/Library/Include/arm_2d_features.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d_features.h" - * Description: Public header file to indicate features avaialble for this - * arm-2d library variant. - * - * $Date: 18. July 2022 - * $Revision: V.1.0.3 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_FEATURES_H__ -#define __ARM_2D_FEATURES_H__ - -/*============================ INCLUDES ======================================*/ - - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * \addtogroup gKernel 1 Kernel - * @{ - */ - -#ifndef __ARM_2D_SKIP_CFG_HEADER__ -# ifndef __ARM_2D_USER_CFG_HEADER__ -# include "arm_2d_cfg.h" -# else -# include __ARM_2D_USER_CFG_HEADER__ -# endif -#endif - -/*============================ MACROS ========================================*/ - -#undef __ARM_2D_HAS_HELIUM__ -#undef __ARM_2D_HAS_HELIUM_INTEGER__ -#undef __ARM_2D_HAS_HELIUM_FLOAT__ - -#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE -# define __ARM_2D_HAS_HELIUM__ 1 -# define __ARM_2D_HAS_HELIUM_INTEGER__ 1 -# if (__ARM_FEATURE_MVE & 2) -# define __ARM_2D_HAS_HELIUM_FLOAT__ 1 -# else -# define __ARM_2D_HAS_HELIUM_FLOAT__ 0 -# endif -#else -# define __ARM_2D_HAS_HELIUM__ 0 -# define __ARM_2D_HAS_HELIUM_INTEGER__ 0 -# define __ARM_2D_HAS_HELIUM_FLOAT__ 0 -#endif - - -#ifndef __ARM_2D_HAS_CDE__ -# define __ARM_2D_HAS_CDE__ 0 -#endif - -#ifndef __ARM_2D_HAS_HW_ACC__ -# define __ARM_2D_HAS_HW_ACC__ 0 -#endif -#if defined(__ARM_2D_HAS_HW_ACC__) && __ARM_2D_HAS_HW_ACC__ -# if defined(__ARM_2D_HAS_ASYNC__) && !__ARM_2D_HAS_ASYNC__ -# warning As long as __ARM_2D_HAS_HW_ACC__ is set to 1,\ - __ARM_2D_HAS_ASYNC__ is forced to 1. Since you set __ARM_2D_HAS_ASYNC__ to\ - 0, please remove your macro definition for __ARM_2D_HAS_ASYNC__ to avoid this\ - warning. -# endif -# undef __ARM_2D_HAS_ASYNC__ -# define __ARM_2D_HAS_ASYNC__ 1 -#endif - -#ifndef __ARM_2D_HAS_ASYNC__ -# define __ARM_2D_HAS_ASYNC__ 1 -#endif -#if defined(__ARM_2D_HAS_ASYNC__) && __ARM_2D_HAS_ASYNC__ -# if !defined(__ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__) || \ - __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ < 4 -# define __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ 4 -# endif -#endif - -#undef __ARM_2D_HAS_FPU__ -#if defined(__ARM_FP) -#define __ARM_2D_HAS_FPU__ 1 -#else -#define __ARM_2D_HAS_FPU__ 0 -#endif - -#undef __ARM_2D_HAS_DSP__ -#if defined(__ARM_FEATURE_DSP) && __ARM_FEATURE_DSP -#define __ARM_2D_HAS_DSP__ 1 -#else -#define __ARM_2D_HAS_DSP__ 0 -#endif - -#ifndef __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ -# ifdef __ARM_2D_HAS_INTERPOLATION_ROTATION__ -# warning __ARM_2D_HAS_INTERPOLATION_ROTATION__ is deprecated, please use __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ instead. -/*! \brief __ARM_2D_HAS_INTERPOLATION_ROTATION__ is deprecated - *! add this for backward compatible - */ -# define __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ \ - __ARM_2D_HAS_INTERPOLATION_ROTATION__ -# else -# define __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ 0 -# endif -#endif - - -/*! \note DO NOT define macro __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ unless - *! you sure about what you are doing. - */ -#if !__ARM_2D_HAS_FPU__ -# undef __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ -# define __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ 1 -#elif !__ARM_2D_HAS_HELIUM__ \ - && !defined(__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__) - /*! \note For Armv7-m processors and Armv8-m processors that have no Helium - *! extension but only FPU, fixed point rotation is faster than the - *! float point rotation even if FPU can accelerate float point - *! operations. - */ -# define __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ 1 -#endif - -#if __ARM_2D_HAS_HELIUM_INTEGER__ && !__ARM_2D_HAS_HELIUM_FLOAT__ -# undef __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ -# define __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ 1 -#endif - -#ifndef __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ -# define __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ 1 -#endif - -/*! \note In your application, if you do need to use RGBA8888 for some resources - *! and you want to use colour channels (e.g. the alpha channel) in mask - *! related APIs, please set this macro to 1 in your project. - */ -#ifndef __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ -# define __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ 1 -#endif - -/*----------------------------------------------------------------------------* - * Unsafe configurations * - *----------------------------------------------------------------------------* - * Following macro switches are used to improve performance with aggressive * - * methods which might cause errors or distortions in some cases. * - * Those macros are undefined by defaults. Please use with cautions. * - *----------------------------------------------------------------------------* - * * - * 1. __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__ * - * This option is used to remove calibration in angle computations to gain * - * a better performance, small error might be noticible for angles like * - * 90, 180, 270 etc. * - * * - * 2. __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT__ * - * This option is used to speed up M-cores without DSP support * - * It skips saturation in the QADD/QDADD/QDSUB involved in the rotation. * - * The chances of overflow remain low as elements involved are using * - * non-accumulating Q15.16 format and integer parts are in the range of * - * the screen size providing enough margin. * - * * - * 3. __ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__ * - * When define this macro, alpha value 0xFF will not be treated as opaque * - * in mask related operations you can barely see the background. Defining * - * this macro can get a big performance uplift. * - *----------------------------------------------------------------------------*/ - - -/*! \note __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__ is - * deprecated. - * Please use __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__ instead. - */ -#ifndef __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__ -# ifdef __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__ - -# warning __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__\ - is deprecated, please use __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__\ - instead. - -# define __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__ \ - __ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__ -# endif -#endif - -/*! \note __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT_FOR_PERFROMANCE__ is - * deprecated. - * Please use __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT__ instead. - */ -#ifndef __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT__ -# ifdef __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT_FOR_PERFROMANCE__ -# warning __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT_FOR_PERFROMANCE__\ - is deprecated, please use __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT__\ - instead. - -# define __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT__ \ - __ARM_2D_CFG_UNSAFE_NO_SATURATION_IN_FIXED_POINT_FOR_PERFROMANCE__ -#endif -#endif - -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*! @} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_op.h b/package/Arm2D/Library/Include/arm_2d_op.h deleted file mode 100644 index 4bf7d7c85..000000000 --- a/package/Arm2D/Library/Include/arm_2d_op.h +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d.h" - * Description: Public header file to contain the all avaialble Arm-2D - * interface header files - * - * $Date: 17. May 2022 - * $Revision: V.1.2.0 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_OP_H__ -#define __ARM_2D_OP_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*============================ MACROS ========================================*/ -#define LOW_LEVEL_IO__ARM_2D_IO_NONE (*(void *)NULL) - -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ - -/*----------------------------------------------------------------------------* - * Misc * - *----------------------------------------------------------------------------*/ -extern -const __arm_2d_op_info_t ARM_2D_OP_BARRIER; - -/*----------------------------------------------------------------------------* - * Basic Tile Operation (Core) * - *----------------------------------------------------------------------------*/ -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_ONLY_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_ONLY_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_ONLY_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_X_MIRROR_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_X_MIRROR_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_X_MIRROR_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_Y_MIRROR_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_Y_MIRROR_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_Y_MIRROR_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_XY_MIRROR_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_XY_MIRROR_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_XY_MIRROR_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_ONLY_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_ONLY_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_ONLY_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_X_MIRROR_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_X_MIRROR_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_X_MIRROR_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_Y_MIRROR_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_Y_MIRROR_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_Y_MIRROR_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_XY_MIRROR_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_XY_MIRROR_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_XY_MIRROR_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_RGB32; - - -/*----------------------------------------------------------------------------* - * Alpha-Blending and Masks * - *----------------------------------------------------------------------------*/ -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_CCCN888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_CCCN888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_RGB888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_COLOUR_FILL_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_COLOUR_FILL_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_COLOUR_FILL_RGB888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_MASK_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_MASK_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_MASK_CCCN888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_CCCN888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_DES_MASK_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_DES_MASK_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_DES_MASK_CCCN888; - -/*----------------------------------------------------------------------------* - * Basic Drawing * - *----------------------------------------------------------------------------*/ -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_DRAW_POINT_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_DRAW_POINT_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_DRAW_POINT_RGB32; - -extern -const __arm_2d_op_info_t ARM_2D_OP_DRAW_PATTERN_C8BIT; - -extern -const __arm_2d_op_info_t ARM_2D_OP_DRAW_PATTERN_RGB16; - -extern -const __arm_2d_op_info_t ARM_2D_OP_DRAW_PATTERN_RGB32; - -/*----------------------------------------------------------------------------* - * Colour Conversion * - *----------------------------------------------------------------------------*/ -extern -const __arm_2d_op_info_t ARM_2D_OP_CONVERT_TO_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_CONVERT_TO_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_CONVERT_TO_RGB888; - -/*----------------------------------------------------------------------------* - * Transform * - *----------------------------------------------------------------------------*/ -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_CCCN888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_OPACITY_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_OPACITY_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_OPACITY_CCCN888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_CCCN888; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_GRAY8; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_RGB565; - -extern -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_CCCN888; - -/*============================ PROTOTYPES ====================================*/ - - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_tile.h b/package/Arm2D/Library/Include/arm_2d_tile.h deleted file mode 100644 index 83ab8e40b..000000000 --- a/package/Arm2D/Library/Include/arm_2d_tile.h +++ /dev/null @@ -1,1274 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm_2d_tile.h - * Description: Public header file to contain the basic tile operations - * - * $Date: 09. Aug 2022 - * $Revision: V.1.0.3 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_TILE_H__ -#define __ARM_2D_TILE_H__ - -/*============================ INCLUDES ======================================*/ -#include "arm_2d_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - - - -/*============================ MACROS ========================================*/ - -/*! - * \addtogroup Deprecated - * @{ - */ -#define arm_2d_c8bit_tile_copy_with_colour_masking \ - arm_2d_c8bit_tile_copy_with_colour_keying - -#define arm_2d_rgb16_tile_copy_with_colour_masking \ - arm_2d_rgb16_tile_copy_with_colour_keying - -#define arm_2d_rgb32_tile_copy_with_colour_masking \ - arm_2d_rgb32_tile_copy_with_colour_keying -/*! @} */ - -/*! - * \addtogroup Tile 2 Tile Operations - * @{ - */ -/*============================ MACROFIED FUNCTIONS ===========================*/ - -#define arm_2d_c8bit_tile_copy( __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR, /* target region address*/\ - __MODE) /* mode */ \ - arm_2dp_c8bit_tile_copy(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR), \ - (__MODE)) - -#define arm_2d_rgb16_tile_copy( __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR, /* target region address*/\ - __MODE) /* mode */ \ - arm_2dp_rgb16_tile_copy(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR), \ - (__MODE)) - -#define arm_2d_rgb32_tile_copy( __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR, /* target region address*/\ - __MODE) /* mode */ \ - arm_2dp_rgb32_tile_copy(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR), \ - (__MODE)) - -#define arm_2d_c8bit_tile_copy_only( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_copy_only(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_copy_only( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_copy_only(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_copy_only( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_copy_only(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_copy_with_x_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_copy_with_x_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_copy_with_x_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_copy_with_x_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_copy_with_x_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_copy_with_x_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_copy_with_y_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_copy_with_y_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_copy_with_y_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_copy_with_y_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_copy_with_y_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_copy_with_y_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_copy_with_xy_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_copy_with_xy_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_copy_with_xy_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_copy_with_xy_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_copy_with_xy_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_copy_with_xy_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_fill_only( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_fill_only(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_fill_only( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_fill_only(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_fill_only( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_fill_only(NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_fill_with_x_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_fill_with_x_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_fill_with_x_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_fill_with_x_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_fill_with_x_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_fill_with_x_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_fill_with_y_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_fill_with_y_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_fill_with_y_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_fill_with_y_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_fill_with_y_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_fill_with_y_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_fill_with_xy_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_c8bit_tile_fill_with_xy_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb16_tile_fill_with_xy_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb16_tile_fill_with_xy_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_rgb32_tile_fill_with_xy_mirror( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR) /* target region address*/\ - arm_2dp_rgb32_tile_fill_with_xy_mirror( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR)) - -#define arm_2d_c8bit_tile_copy_with_colour_keying( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR, /* target region address*/\ - __MSK_COLOUR, /* mask(key) colour */ \ - __MODE) /* mode */ \ - arm_2dp_c8bit_tile_copy_with_colour_keying( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR), \ - (__MSK_COLOUR), \ - (__MODE)) - - -#define arm_2d_rgb16_tile_copy_with_colour_keying( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR, /* target region address*/\ - __MSK_COLOUR, /* mask(key) colour */ \ - __MODE) /* mode */ \ - arm_2dp_rgb16_tile_copy_with_colour_keying( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR), \ - (__MSK_COLOUR), \ - (__MODE)) - -#define arm_2d_rgb32_tile_copy_with_colour_keying( \ - __SRC_ADDR, /* source tile address */ \ - __DES_ADDR, /* target tile address */ \ - __DES_REGION_ADDR, /* target region address*/\ - __MSK_COLOUR, /* mask(key) colour */ \ - __MODE) /* mode */ \ - arm_2dp_rgb32_tile_copy_with_colour_keying( \ - NULL, \ - (__SRC_ADDR), \ - (__DES_ADDR), \ - (__DES_REGION_ADDR), \ - (__MSK_COLOUR), \ - (__MODE)) - - -/* - calculate the start address - HOW IT WORKS: - - Base Address - +------------------------------------------------------------------------+ - | | - |<------------------------------- iWidth ------------------------------->| - | | - | | - | Start Address = Base Address + iX + iY * iWidth | - | (iX,iY) | - |<-------- iX --------->+------------------------------+ | - | | | | - | | Valid Region | | - | | | | - | +------------------------------+ | - ... ... - | | - +------------------------------------------------------------------------+ - */ - -#define __arm_2d_get_address_and_region_from_tile( __TILE_PTR, \ - __VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR, \ - __TYPE, \ - __BUF_PTR_NAME) \ - arm_2d_region_t __VALID_REGION_NAME; \ - assert(NULL != (__TILE_PTR)); \ - __TYPE *(__BUF_PTR_NAME) = NULL; \ - \ - (__TILE_PTR) = arm_2d_tile_get_root((__TILE_PTR), \ - &__VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR); \ - \ - if (NULL != (__TILE_PTR)) { \ - (__BUF_PTR_NAME) = ((__TYPE *)((__TILE_PTR)->pchBuffer)) \ - + (__TILE_PTR)->tRegion.tSize.iWidth * \ - __VALID_REGION_NAME.tLocation.iY \ - + __VALID_REGION_NAME.tLocation.iX; \ - } - - -#define arm_2d_get_address_and_region_from_tile(__TILE_PTR, \ - __VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR, \ - __TYPE, \ - __BUF_PTR_NAME) \ - __arm_2d_get_address_and_region_from_tile( __TILE_PTR, \ - __VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR, \ - __TYPE, \ - __BUF_PTR_NAME) - - -#define __arm_2d_get_address_and_region_from_tile_with_mirroring( \ - __TILE_PTR, \ - __VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR, \ - __TYPE, \ - __BUF_PTR_NAME, \ - __MODE) \ - arm_2d_region_t __VALID_REGION_NAME; \ - assert(NULL != (__TILE_PTR)); \ - __TYPE *(__BUF_PTR_NAME) = NULL; \ - \ - (__TILE_PTR) = arm_2d_tile_get_root((__TILE_PTR), \ - &__VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR); \ - \ - if (NULL != (__TILE_PTR)) { \ - arm_2d_location_t tOffset = __VALID_REGION_NAME.tLocation; \ - if ((__MODE) & ARM_2D_CP_MODE_X_MIRROR) { \ - tOffset.iX = 0; \ - } \ - if ((__MODE) & ARM_2D_CP_MODE_Y_MIRROR) { \ - tOffset.iY = 0; \ - } \ - (__BUF_PTR_NAME) = ((__TYPE *)((__TILE_PTR)->pchBuffer)) \ - + (__TILE_PTR)->tRegion.tSize.iWidth * tOffset.iY \ - + tOffset.iX; \ - } - - -#define arm_2d_get_address_and_region_from_tile_with_mirroring( \ - __TILE_PTR, \ - __VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR, \ - __TYPE, \ - __BUF_PTR_NAME, \ - __MODE) \ - __arm_2d_get_address_and_region_from_tile_with_mirroring( \ - __TILE_PTR, \ - __VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR, \ - __TYPE, \ - __BUF_PTR_NAME, \ - (__MODE)) - -/*============================ TYPES =========================================*/ - -typedef arm_2d_op_src_t arm_2d_op_cp_t; - -/*! \note arm_2d_op_cp_cl_key_t inherits from arm_2d_op_src_t explicitly - */ -typedef struct arm_2d_op_cp_cl_key_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; //!< copy mode - union { - uint8_t chColour; //!< 8bit colour - uint16_t hwColour; //!< 16bit colour - uint32_t wColour; //!< 32bit colour - }; -} arm_2d_op_cp_cl_key_t; - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - - -/*----------------------------------------------------------------------------* - * Tile Operations * - *----------------------------------------------------------------------------*/ - -/*! - * \brief check whether a given tile is root or not - * \param[in] ptTile the target tile - * \retval true the target tile is a root tile - * \retval false the target tile is a child tile - */ -ARM_NONNULL(1) -__STATIC_INLINE bool arm_2d_is_root_tile(const arm_2d_tile_t *ptTile) -{ - return ptTile->tInfo.bIsRoot; -} - - -/*! - * \brief intersect two regions and find the overlapped region - * \param[in] ptRegionIn0 the input region 0 - * \param[in] ptRegionIn1 the input region 1 - * \param[out] ptRegionOut the overlapped region - * \retval false the two regions do not overlap - * \retval true the two regions overlap - * - * \code - - HOW IT WORKS: - - Input Region 0 - +------------------------------------------------------+ - | | - | | - | | - | +------------------------------+---------+ - | | |/////////| - | | Output Region |/////////| - | | |/////////| - +-----------------------+------------------------------+/////////| - |////////////////////////////////////////| - |////////////////////////////////////////| - +----------------------------------------+ - Input Region 1 - * \endcode - */ -extern -ARM_NONNULL(1,2) -bool arm_2d_region_intersect( const arm_2d_region_t *ptRegionIn0, - const arm_2d_region_t *ptRegionIn1, - arm_2d_region_t *ptRegionOut); - -/*! - * \brief check whether a point is inside a given region - * \param[in] ptRegion the target region - * \param[in] ptPoint the target point - * \retval true the point is inside the target region - * \retval false the point is outside the target region - */ -extern -ARM_NONNULL(1,2) -bool arm_2d_is_point_inside_region( const arm_2d_region_t *ptRegion, - const arm_2d_location_t *ptPoint); - -/*! - * \brief get the root tile and the valid region for a given tile - * \param[in] ptTile the target tile - * \param[out] ptValidRegion the valid region inside the root tile - * \param[out] ptOffset the offsite of the root tile as if the root tile is inside the target tile - * \return const arm_2d_tile_t* the root tile - * - * \code - HOW IT WORKS: - - Root Tile (Output Tile) - +------------------------------------------------------------------------+ - | ... ... | - | | - | Child Tile of Parent Tile | - | +------------------------------------+ | - | | Child Tile of Parent Tile | | - | | +------------------------------+---------+ | - | | | |/////////| | - | | | Valid Region |/////////| | - | | | |/////////| | - | +-----+------------------------------+/////////| | - | |////////////////////////////////////////| | - | |////////////////////////////////////////| | - | +----------------------------------------+ | - | | - +------------------------------------------------------------------------+ - \endcode - */ -extern -ARM_NONNULL(1,2) -const arm_2d_tile_t *arm_2d_tile_get_root( const arm_2d_tile_t *ptTile, - arm_2d_region_t *ptValidRegion, - arm_2d_location_t *ptOffset); - -/*! - * \brief generate a child tile from the target tile with a given region - * \param[in] ptTargetTile the target tile - * \param[in] ptRegion the target region - * \param[out] ptOutput the child tile - * \param[in] bClipRegion whether clip the region for the child tile - * \note We highly recommend that please DO NOT clip the child tile if - * you don't know what you are doing. - * \retval non-NULL the child tile - * \retval NULL the given region is outside the target tile - * - * \note If you want to use the child tile generated by - * arm_2d_tile_generate_child() as a source tile / mask, please set the - * bDerivedResource to true manually, otherwise all mirror related - * operation will NOT work correctly. - * - * \code - HOW IT WORKS: - - Parent Tile (NOT necessarily a ROOT tile ) - +------------------------------------------------------+ - | | - | | - | Target Region | - | +------------------------------+---------+ - | | |/////////| - | | New Child Tile (Output) |/////////| - | | |/////////| - +-----------------------+------------------------------+/////////| - |////////////////////////////////////////| - |////////////////////////////////////////| - +----------------------------------------+ - \endcode - */ -extern -ARM_NONNULL(1,2,3) -arm_2d_tile_t *arm_2d_tile_generate_child( - const arm_2d_tile_t *ptTargetTile, - const arm_2d_region_t *ptRegion, - arm_2d_tile_t *ptOutput, - bool bClipRegion); - -/*! - * \brief compare the widths of two tiles - * \param[in] ptTarget the target tile - * \param[in] ptReference the reference tile - * \return arm_2d_cmp_t the comparision result - */ -extern -ARM_NONNULL(1,2) -arm_2d_cmp_t arm_2d_tile_width_compare( const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference); -/*! - * \brief compare the heights of two tiles - * \param[in] ptTarget the target tile - * \param[in] ptReference the reference tile - * \return arm_2d_cmp_t the comparision result - */ -extern -ARM_NONNULL(1,2) -arm_2d_cmp_t arm_2d_tile_height_compare(const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference); - -/*! - * \brief compare the shape (both widths and heights) of two tiles - * \param[in] ptTarget the target tile - * \param[in] ptReference the reference tile - * \return arm_2d_cmp_t the comparision result - */ -extern -ARM_NONNULL(1,2) -arm_2d_cmp_t arm_2d_tile_shape_compare( const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference); - -/*! - * \brief get the absolute location of a given tile - * \param[in] ptTile the target tile - * \param[out] ptLocation the absolute location in the root tile - * \return const arm_2d_tile_t * the root tile - */ -extern -ARM_NONNULL(1,2) -const arm_2d_tile_t * arm_2d_get_absolute_location( - const arm_2d_tile_t *ptTile, - arm_2d_location_t *ptLocation); - -/*! - * \brief calculate the region differences between two tiles - * \param[in] ptTarget the target tile - * \param[in] ptReference the reference tile - * \param[out] ptBuffer the difference stored in a region - * \return arm_2d_region_t * the ptBuffer passed to this function - */ -extern -ARM_NONNULL(1,2,3) -arm_2d_region_t *arm_2d_tile_region_diff( const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference, - arm_2d_region_t *ptBuffer); -/*----------------------------------------------------------------------------* - * Copy/Fill tile to destination with Mirroring * - *----------------------------------------------------------------------------*/ - -/*! - * \brief tile copy modes - */ -enum __arm_2d_copy_mode_t { - ARM_2D_CP_MODE_COPY = 0, - ARM_2D_CP_MODE_FILL = _BV(0), - ARM_2D_CP_MODE_Y_MIRROR = _BV(2), - ARM_2D_CP_MODE_X_MIRROR = _BV(3), - ARM_2D_CP_MODE_XY_MIRROR = ARM_2D_CP_MODE_X_MIRROR | - ARM_2D_CP_MODE_Y_MIRROR, -}; - -/*! - * \brief tile copy with specified mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy(arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief tile copy with specified mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy(arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*! - * \brief tile copy with specified mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy(arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode); - -/*----------------------------------------------------------------------------* - * Copy Only * - *----------------------------------------------------------------------------*/ -/*! - * \brief tile copy only - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy only - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy only - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Copy with X mirroring * - *----------------------------------------------------------------------------*/ -/*! - * \brief tile copy with x-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy with x-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy with x-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Copy with Y mirroring * - *----------------------------------------------------------------------------*/ - -/*! - * \brief tile copy with y-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy with y-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy with y-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Copy with XY mirroring * - *----------------------------------------------------------------------------*/ - -/*! - * \brief tile copy with xy-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy with xy-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief tile copy with xy-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Fill Only * - *----------------------------------------------------------------------------*/ - -/*! - * \brief Tiling only - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling only - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling only - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Fill with X mirroring * - *----------------------------------------------------------------------------*/ - -/*! - * \brief Tiling with x-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling with x-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling with x-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Fill with Y mirroring * - *----------------------------------------------------------------------------*/ - -/*! - * \brief Tiling with y-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling with y-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling with y-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Fill with XY mirroring * - *----------------------------------------------------------------------------*/ - -/*! - * \brief Tiling with xy-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling with xy-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*! - * \brief Tiling with xy-mirroring - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion); - -/*----------------------------------------------------------------------------* - * Copy/Fill tile to destination with colour-keying and mirroring * - *----------------------------------------------------------------------------*/ - -/*! - * \brief tile copy with colour-keying and specified mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \param[in] chMaskColour the key colour in any 8bit colour format - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_colour_keying( - arm_2d_op_cp_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint8_t chMaskColour, - uint32_t wMode); - -/*! - * \brief tile copy with colour-keying and specified mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \param[in] hwMaskColour the key colour in any 16bit colour format - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - * - * \note alpha channel is not handled, i.e. rgba5551 - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_colour_keying( - arm_2d_op_cp_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint16_t hwMaskColour, - uint32_t wMode); - - -/*! - * \brief tile copy with colour-keying and specified mode - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region, NULL means using the region of the - * target tile. - * \param[in] wMaskColour the key colour in any 32bit colour format - * \param[in] wMode the copy mode - * \return arm_fsm_rt_t the operation result - * - * \note alpha channel is not handled - */ -extern -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_colour_keying( - arm_2d_op_cp_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMaskColour, - uint32_t wMode); - -/*! @} */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_transform.h b/package/Arm2D/Library/Include/arm_2d_transform.h deleted file mode 100644 index a795e01d2..000000000 --- a/package/Arm2D/Library/Include/arm_2d_transform.h +++ /dev/null @@ -1,3119 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: #include "arm_2d_transform.h" - * Description: Public header file to contain the APIs for transform - * - * $Date: 17 June 2022 - * $Revision: V.1.0.1 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_ROTATION_H__ -#define __ARM_2D_ROTATION_H__ - -/*============================ INCLUDES ======================================*/ - -#include "arm_2d_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#endif - -/*============================ MACROS ========================================*/ -/*! - * \addtogroup Deprecated - * @{ - */ -#define arm_2d_op_rotate_t arm_2d_op_trans_t -#define arm_2d_op_rotate_opacity_t arm_2d_op_trans_opa_t -/*! @} */ - -/*! - * \addtogroup Deprecated - * @{ - */ -#define arm_2dp_tile_rotate arm_2dp_tile_transform - -#define arm_2dp_gray8_tile_rotate_prepare \ - arm_2dp_gray8_tile_transform_prepare - -#define arm_2dp_rgb565_tile_rotate_prepare \ - arm_2dp_rgb565_tile_transform_prepare - -#define arm_2dp_cccn888_tile_rotate_prepare \ - arm_2dp_cccn888_tile_transform_prepare - -#define arm_2dp_gray8_tile_rotate_with_opacity_prepare \ - arm_2dp_gray8_tile_transform_with_opacity_prepare - -#define arm_2dp_rgb565_tile_rotate_with_opacity_prepare \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare - -#define arm_2dp_cccn888_tile_rotate_with_opacity_prepare \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare - -#define arm_2d_gray8_tile_rotation_with_alpha_prepare \ - arm_2d_gray8_tile_rotation_with_opacity_prepare - -#define arm_2d_rgb565_tile_rotation_with_alpha_prepare \ - arm_2d_rgb565_tile_rotation_with_opacity_prepare - -#define arm_2d_rgb888_tile_rotation_with_alpha_prepare \ - arm_2d_rgb888_tile_rotation_with_opacity_prepare - -#define arm_2d_cccn888_tile_rotation_with_alpha_prepare \ - arm_2d_cccn888_tile_rotation_with_opacity_prepare - -#define arm_2dp_gray8_tile_rotation_with_alpha \ - arm_2dp_gray8_tile_rotation_with_opacity - -#define arm_2dp_rgb565_tile_rotation_with_alpha \ - arm_2dp_rgb565_tile_rotation_with_opacity - -#define arm_2dp_rgb888_tile_rotation_with_alpha \ - arm_2dp_rgb888_tile_rotation_with_opacity - -#define arm_2dp_cccn888_tile_rotation_with_alpha \ - arm_2dp_cccn888_tile_rotation_with_opacity - -#define arm_2d_gray8_tile_rotation_with_alpha \ - arm_2d_gray8_tile_rotation_with_opacity - -#define arm_2d_rgb565_tile_rotation_with_alpha \ - arm_2d_rgb565_tile_rotation_with_opacity - -#define arm_2d_rgb888_tile_rotation_with_alpha \ - arm_2d_rgb888_tile_rotation_with_opacity - -#define arm_2d_cccn888_tile_rotation_with_alpha \ - arm_2d_cccn888_tile_rotation_with_opacity - -#define arm_2d_gray8_tile_transform_with_alpha_prepare \ - arm_2d_gray8_tile_transform_with_opacity_prepare - -#define arm_2d_rgb565_tile_transform_with_alpha_prepare \ - arm_2d_rgb565_tile_transform_with_opacity_prepare - -#define arm_2d_rgb888_tile_transform_with_alpha_prepare \ - arm_2d_rgb888_tile_transform_with_opacity_prepare - -#define arm_2d_cccn888_tile_transform_with_alpha_prepare \ - arm_2d_cccn888_tile_transform_with_opacity_prepare - -#define arm_2d_gray8_tile_transform_with_alpha \ - arm_2d_gray8_tile_transform_with_opacity - -#define arm_2d_rgb565_tile_transform_with_alpha \ - arm_2d_rgb565_tile_transform_with_opacity - -#define arm_2d_rgb888_tile_transform_with_alpha \ - arm_2d_rgb888_tile_transform_with_opacity - -#define arm_2d_cccn888_tile_transform_with_alpha \ - arm_2d_cccn888_tile_transform_with_opacity - -#define arm_2dp_gray8_tile_transform_with_alpha \ - arm_2dp_gray8_tile_transform_with_opacity - -#define arm_2dp_rgb565_tile_transform_with_alpha \ - arm_2dp_rgb565_tile_transform_with_opacity - -#define arm_2dp_rgb888_tile_transform_with_alpha \ - arm_2dp_rgb888_tile_transform_with_opacity - -#define arm_2dp_cccn888_tile_transform_with_alpha \ - arm_2dp_cccn888_tile_transform_with_opacity - -#define arm_2d_gray8_tile_scaling_with_alpha_prepare \ - arm_2d_gray8_tile_scaling_with_opacity_prepare - -#define arm_2d_rgb565_tile_scaling_with_alpha_prepare \ - arm_2d_rgb565_tile_scaling_with_opacity_prepare - -#define arm_2d_rgb888_tile_scaling_with_alpha_prepare \ - arm_2d_rgb888_tile_scaling_with_opacity_prepare - -#define arm_2d_cccn888_tile_scaling_with_alpha_prepare \ - arm_2d_cccn888_tile_scaling_with_opacity_prepare - -#define arm_2dp_gray8_tile_scaling_with_alpha \ - arm_2dp_gray8_tile_scaling_with_opacity - -#define arm_2dp_rgb565_tile_scaling_with_alpha \ - arm_2dp_rgb565_tile_scaling_with_opacity - -#define arm_2dp_rgb888_tile_scaling_with_alpha \ - arm_2dp_rgb888_tile_scaling_with_opacity - -#define arm_2dp_cccn888_tile_scaling_with_alpha \ - arm_2dp_cccn888_tile_scaling_with_opacity - -#define arm_2d_gray8_tile_scaling_with_alpha \ - arm_2d_gray8_tile_scaling_with_opacity - -#define arm_2d_rgb565_tile_scaling_with_alpha \ - arm_2d_rgb565_tile_scaling_with_opacity - -#define arm_2d_rgb888_tile_scaling_with_alpha \ - arm_2d_rgb888_tile_scaling_with_opacity - -#define arm_2d_cccn888_tile_scaling_with_alpha \ - arm_2d_cccn888_tile_scaling_with_opacity -/*! @} */ - -/*! - * \addtogroup gTransform 5 Transform Operations - * @{ - */ - -/*============================ MACROFIED FUNCTIONS ===========================*/ - -/*----------------------------------------------------------------------------* - * API wrappers: Rotation * - *----------------------------------------------------------------------------*/ - -#define arm_2d_gray8_tile_rotation_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR) \ - arm_2dp_gray8_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)) - -#define arm_2d_rgb565_tile_rotation_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR) \ - arm_2dp_rgb565_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)) - -#define arm_2d_rgb888_tile_rotation_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR) \ - arm_2dp_cccn888_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)) - -#define arm_2d_gray8_tile_rotation_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)) - -#define arm_2d_rgb565_tile_rotation_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)) - - -#define arm_2d_rgb888_tile_rotation_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)) - - -#define arm_2d_cccn888_tile_rotation_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)) - -#define arm_2d_gray8_tile_rotation_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE) \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f) - -#define arm_2d_rgb565_tile_rotation_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE) \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f) - -#define arm_2d_cccn888_tile_rotation_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE) \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f) - -#define arm_2d_gray8_tile_rotation_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY) \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__OPACITY)) - -#define arm_2d_rgb565_tile_rotation_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY) \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__OPACITY)) - -#define arm_2d_cccn888_tile_rotation_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY) \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - 1.0f, \ - (__OPACITY)) - -#define arm_2d_tile_rotate( __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __DES_CENTRE_ADDR) \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (__DES_CENTRE_ADDR)) - - -/* following macro APIs rely on the boolean variable bIsNewFrame. - * Please make sure you have define it with the correct name and the - * corresponding value. If you don't use the PFB interfaces for neight - * the low level rendering nor the high level GUI drawing, please find - * such variable with the value "true". - */ - -#define arm_2dp_gray8_tile_rotation( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_rotation( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_cccn888_tile_rotation( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - - -#define arm_2dp_gray8_tile_rotation_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_rgb565_tile_rotation_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - - -#define arm_2dp_rgb888_tile_rotation_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_cccn888_tile_rotation_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_gray8_tile_rotation_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_rotation_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_cccn888_tile_rotation_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_gray8_tile_rotation_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_rotation_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_cccn888_tile_rotation_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_rotation( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2d_rgb565_tile_rotation( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2d_rgb888_tile_rotation( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_rotation_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_rotation_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb888_tile_rotation_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_rotation_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_rotation_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_rotation_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_rotation_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_rotation_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_rotation_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_rotation_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (__ANGLE), \ - 1.0f, \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -/*----------------------------------------------------------------------------* - * API wrappers: Transform * - *----------------------------------------------------------------------------*/ - -#define arm_2d_gray8_tile_transform_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR) \ - arm_2dp_gray8_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)) - -#define arm_2d_rgb565_tile_transform_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR) \ - arm_2dp_rgb565_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)) - - -#define arm_2d_rgb888_tile_transform_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR) \ - arm_2dp_cccn888_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)) - - -#define arm_2d_gray8_tile_transform_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - -#define arm_2d_rgb565_tile_transform_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - - -#define arm_2d_rgb888_tile_transform_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - - -#define arm_2d_cccn888_tile_transform_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - -#define arm_2d_gray8_tile_transform_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE) \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)) - -#define arm_2d_rgb565_tile_transform_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE) \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)) - -#define arm_2d_cccn888_tile_transform_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE) \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)) - -#define arm_2d_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY) \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)) - -#define arm_2d_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY) \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)) - -#define arm_2d_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY) \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)) - -#define arm_2d_tile_transform( __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __DES_CENTRE_ADDR) \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (__DES_CENTRE_ADDR)) - - -/* following macro APIs rely on the boolean variable bIsNewFrame. - * Please make sure you have define it with the correct name and the - * corresponding value. If you don't use the PFB interfaces for neither - * the low level rendering nor the high level GUI drawing, please find - * such variable with the value "true". - */ - -#define arm_2dp_gray8_tile_transform( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_transform( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_cccn888_tile_transform( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_gray8_tile_transform_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_rgb565_tile_transform_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb888_tile_transform_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_cccn888_tile_transform_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_gray8_tile_transform_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_transform_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_cccn888_tile_transform_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_gray8_tile_transform_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2d_gray8_tile_transform( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_transform( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2d_rgb888_tile_transform( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_transform_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_transform_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb888_tile_transform_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - - -#define arm_2d_cccn888_tile_transform_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2d_gray8_tile_transform_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_transform_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_transform_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_transform_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_transform_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_transform_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __ANGLE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - (float)(__ANGLE), \ - (float)(__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -/*----------------------------------------------------------------------------* - * API wrappers: Scaling * - *----------------------------------------------------------------------------*/ -#define arm_2d_gray8_tile_scaling_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR) \ - arm_2dp_gray8_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__MSK_COLOUR)) - -#define arm_2d_rgb565_tile_scaling_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR) \ - arm_2dp_rgb565_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__MSK_COLOUR)) - -#define arm_2d_rgb888_tile_scaling_prepare(__SRC_TILE_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR) \ - arm_2dp_cccn888_tile_transform_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__MSK_COLOUR)) - - - -#define arm_2d_gray8_tile_scaling_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - -#define arm_2d_rgb565_tile_scaling_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - - -#define arm_2d_rgb888_tile_scaling_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - -#define arm_2d_cccn888_tile_scaling_with_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO) \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)) - -#define arm_2d_gray8_tile_scaling_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __SCALE) \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE)) - -#define arm_2d_rgb565_tile_scaling_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __SCALE) \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE)) - -#define arm_2d_cccn888_tile_scaling_with_src_mask_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __SCALE) \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE)) - -#define arm_2d_gray8_tile_scaling_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY) \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__OPACITY)) - -#define arm_2d_rgb565_tile_scaling_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY) \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__OPACITY)) - -#define arm_2d_cccn888_tile_scaling_with_src_mask_and_opacity_prepare( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY) \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (float)(__SCALE), \ - (__OPACITY)) - -#define arm_2d_tile_scale( __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __DES_CENTRE_ADDR) \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (__DES_CENTRE_ADDR)) - - -/* following macro APIs rely on the boolean variable bIsNewFrame. - * Please make sure you have define it with the correct name and the - * corresponding value. If you don't use the PFB interfaces for neither - * the low level rendering nor the high level GUI drawing, please find - * such variable with the value "true". - */ - -#define arm_2dp_gray8_tile_scaling( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_scaling( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_cccn888_tile_scaling( __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_gray8_tile_scaling_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_scaling_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO,...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb888_tile_scaling_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_cccn888_tile_scaling_with_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2dp_gray8_tile_scaling_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_scaling_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_cccn888_tile_scaling_with_src_mask( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_gray8_tile_scaling_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_rgb565_tile_scaling_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2dp_cccn888_tile_scaling_with_src_mask_and_opacity( \ - __CB_ADDR, \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({assert(NULL != (__CB_ADDR)); if (bIsNewFrame) { \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - (__CB_ADDR), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform((arm_2d_op_trans_t *)(__CB_ADDR), \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_scaling( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_scaling( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2d_rgb888_tile_scaling( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_scaling_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - -#define arm_2d_rgb565_tile_scaling_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - - - -#define arm_2d_rgb888_tile_scaling_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_scaling_with_opacity( \ - __SRC_TILE_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __MSK_COLOUR, \ - __RATIO, ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_opacity_prepare( \ - NULL, \ - (__SRC_TILE_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__MSK_COLOUR), \ - (__RATIO)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_scaling_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_scaling_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_scaling_with_src_mask( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_src_mask_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_gray8_tile_scaling_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_rgb565_tile_scaling_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -#define arm_2d_cccn888_tile_scaling_with_src_mask_and_opacity( \ - __SRC_TILE_ADDR, \ - __SRC_MASK_ADDR, \ - __DES_TILE_ADDR, \ - __DES_REGION_ADDR, \ - __CENTRE, \ - __SCALE, \ - __OPACITY, \ - ...) \ - ({{ \ - arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( \ - (NULL), \ - (__SRC_TILE_ADDR), \ - (__SRC_MASK_ADDR), \ - (__CENTRE), \ - 0.0f, \ - (__SCALE), \ - (__OPACITY)); \ - }; \ - arm_2dp_tile_transform(NULL, \ - (__DES_TILE_ADDR), \ - (__DES_REGION_ADDR), \ - (NULL,##__VA_ARGS__)); \ - }) - -/*============================ TYPES =========================================*/ - -/*! - * \brief transform runtime context - * - */ -typedef struct __arm_2d_transform_info_t { - float fAngle; //!< target angle - float fScale; //!< scaling factor - arm_2d_location_t tCenter; //!< pivot - union { - uint8_t chColour; //!< the key colour in 8bit - uint32_t wColour; //!< the key colour in 16bit - uint16_t hwColour; //!< the key colour in 32bit - } Mask; - - /* private members used by runtime */ -ARM_PRIVATE( - arm_2d_location_t tDummySourceOffset; - struct { - arm_2d_region_t tRegion; - arm_2d_tile_t tTile; - } Target; -) - -} __arm_2d_transform_info_t; - -/*! \brief arm_2d_op_trans_t is inherit from arm_2d_op_src_orig_t - */ -typedef struct arm_2d_op_trans_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; //!< not used - - struct { - const arm_2d_tile_t *ptTile; //!< the origin tile - arm_2d_tile_t tDummySource; //!< the buffer for the source - }Origin; - - __arm_2d_transform_info_t tTransform; //!< transform context - -} arm_2d_op_trans_t; - - -/*! \brief arm_2d_op_trans_opa_t is inherit from arm_2d_op_trans_t - */ -typedef struct arm_2d_op_trans_opa_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; //!< not used - - struct { - const arm_2d_tile_t *ptTile; //!< the origin tile - arm_2d_tile_t tDummySource; //!< the buffer for the source - }Origin; - - __arm_2d_transform_info_t tTransform; //!< transform context - uint8_t chOpacity; //!< opacity - -} arm_2d_op_trans_opa_t; - - -/*! \brief arm_2d_op_trans_msk_t is inherit from arm_2d_op_src_orig_msk_t - */ -typedef struct arm_2d_op_trans_msk_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; //!< not used - struct { - const arm_2d_tile_t *ptTile; //!< the origin tile - arm_2d_tile_t tDummySource; //!< the buffer for the source - }Origin; - struct { - const arm_2d_tile_t *ptOriginSide; //!< origin side mask - const arm_2d_tile_t *ptTargetSide; //!< target side mask - } Mask; - - __arm_2d_transform_info_t tTransform; //!< transform context - -} arm_2d_op_trans_msk_t; - - -/*! \brief arm_2d_op_trans_msk_t is inherit from arm_2d_op_trans_msk_t - */ -typedef struct arm_2d_op_trans_msk_opa_t { - inherit(arm_2d_op_core_t); //!< base - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; //!< not used - struct { - const arm_2d_tile_t *ptTile; //!< the origin tile - arm_2d_tile_t tDummySource; //!< the buffer for the source - }Origin; - struct { - const arm_2d_tile_t *ptOriginSide; //!< origin side mask - const arm_2d_tile_t *ptTargetSide; //!< target side mask - } Mask; - - __arm_2d_transform_info_t tTransform; //!< transform context - uint8_t chOpacity; //!< opacity - -} arm_2d_op_trans_msk_opa_t; - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*! - * \brief prepare for a transform in gray8 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] chFillColour the key colour - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_gray8_tile_transform_prepare( - arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chFillColour); - -/*! - * \brief prepare for a transform in rgb565 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] hwFillColour the key colour - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_rgb565_tile_transform_prepare( - arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast16_t hwFillColour); - -/*! - * \brief prepare for a transform in cccn888 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] wFillColour the key colour - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_cccn888_tile_transform_prepare( - arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint32_t wFillColour); - -/*! - * \brief prepare for a transform with opacity in gray8 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] chFillColour the key colour - * \param[in] chRatio the opacity - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_gray8_tile_transform_with_opacity_prepare( - arm_2d_op_trans_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chFillColour, - uint_fast8_t chRatio); - -/*! - * \brief prepare for a transform with opacity in rgb565 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] hwFillColour the key colour - * \param[in] chRatio the opacity - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_rgb565_tile_transform_with_opacity_prepare( - arm_2d_op_trans_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast16_t hwFillColour, - uint_fast8_t chRatio); - -/*! - * \brief prepare for a transform with opacity in cccn888 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] wFillColour the key colour - * \param[in] chRatio the opacity - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_cccn888_tile_transform_with_opacity_prepare( - arm_2d_op_trans_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint32_t wFillColour, - uint_fast8_t chRatio); - -/*! - * \brief prepare for a transform with a source mask in gray8 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSourceMask the source mask - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_gray8_tile_transform_with_src_mask_prepare( - arm_2d_op_trans_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale); - -/*! - * \brief prepare for a transform with a source mask in rgb565 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSourceMask the source mask - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_rgb565_tile_transform_with_src_mask_prepare( - arm_2d_op_trans_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale); - -/*! - * \brief prepare for a transform with a source mask in cccn888 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSourceMask the source mask - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_cccn888_tile_transform_with_src_mask_prepare( - arm_2d_op_trans_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale); - -/*! - * \brief prepare for a transform with a source mask and opacity in gray8 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSourceMask the source mask - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] chOpacity the opacity - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( - arm_2d_op_trans_msk_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chOpacity); - -/*! - * \brief prepare for a transform with a source mask and opacity in rgb565 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSourceMask the source mask - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] chOpacity the opacity - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( - arm_2d_op_trans_msk_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chOpacity); - -/*! - * \brief prepare for a transform with a source mask and opacity in cccn888 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[in] ptSourceMask the source mask - * \param[in] tCentre the pivot in the source tile - * \param[in] fAngle the rotation angle - * \param[in] fScale the scaling factor - * \param[in] chOpacity the opacity - * \return arm_2d_err_t the result of the preparing process - */ -extern -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( - arm_2d_op_trans_msk_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chOpacity); - -/*! - * \brief start a transform operation - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] ptTargetCentre the pivot in the target region - * \return arm_fsm_rt_t the operation result - */ -extern -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_tile_transform( arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_location_t *ptTargetCentre); - -/*! @} */ - -#if defined(__clang__) -# pragma clang diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Include/arm_2d_types.h b/package/Arm2D/Library/Include/arm_2d_types.h deleted file mode 100644 index 9a1acec65..000000000 --- a/package/Arm2D/Library/Include/arm_2d_types.h +++ /dev/null @@ -1,903 +0,0 @@ -/* - * Copyright (C) 2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: cmsis_nn_typs.h - * Description: Public header file to contain the Arm-2D structs - * - * $Date: 09. Aug 2022 - * $Revision: V.1.0.4 - * - * Target Processor: Cortex-M cores - * -------------------------------------------------------------------- */ - - -#ifndef __ARM_2D_TYPES_H__ -#define __ARM_2D_TYPES_H__ - -/*============================ INCLUDES ======================================*/ -#include -#include -#include -#include - -#include "arm_2d_features.h" -#include "arm_2d_utils.h" -#include "__arm_2d_math.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wmissing-declarations" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wc11-extensions" -#elif __IS_COMPILER_ARM_COMPILER_5__ -# pragma diag_suppress 64 -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wmissing-declarations" -# pragma GCC diagnostic ignored "-Wpadded" -#endif - -/*! - * \addtogroup gKernel 1 Kernel - * @{ - */ - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ - - -/*----------------------------------------------------------------------------* - * Infrastructure * - *----------------------------------------------------------------------------*/ - -/*! - * \brief finite-state-machine status return (Compatible with arm_status, minimal integer: int8_t) - * - */ -typedef enum { - arm_fsm_rt_err = -1, //!< fsm error - arm_fsm_rt_cpl = 0, //!< fsm complete - arm_fsm_rt_on_going = 1, //!< fsm on-going - arm_fsm_rt_wait_for_obj = 2, //!< fsm wait for IPC object - arm_fsm_rt_async = 3, //!< fsm work asynchronously, please check it later. - arm_fsm_rt_wait_for_res = 4, //!< wait for resource -} arm_fsm_rt_t; - -/*! - * \brief the error code for arm-2d (minimal integer: int8_t) - * - */ -typedef enum { - ARM_2D_ERR_UNSUPPORTED_COLOUR = -11, //!< the specified colour is not supported - ARM_2D_ERR_BUSY = -10, //!< service is busy - ARM_2D_ERR_INSUFFICIENT_RESOURCE = -9, //!< insufficient resource - ARM_2D_ERR_IO_BUSY = -8, //!< HW accelerator is busy - ARM_2D_ERR_IO_ERROR = -7, //!< Generic HW error - ARM_2D_ERR_MISSING_PARAM = -6, //!< missing mandatory parameter - ARM_2D_ERR_INVALID_OP = -5, //!< unsupported / invalid operation - ARM_2D_ERR_NOT_SUPPORT = -4, //!< feature/service/operation is not supported - ARM_2D_ERR_OUT_OF_REGION = -3, //!< the operation is out of target area - ARM_2D_ERR_INVALID_PARAM = -2, //!< invalid parameter - ARM_2D_ERR_UNKNOWN = -1, //!< generic or unknown errors - ARM_2D_ERR_NONE = 0, //!< no error -} arm_2d_err_t; - -/*! - * \brief comparison result - * - */ -typedef enum { - ARM_2D_CMP_SMALLER = -1, //!< the target is smaller than the reference - ARM_2D_CMP_EQUALS = 0, //!< the target is equal to the reference - ARM_2D_CMP_LARGER = 1, //!< the target is larger than the reference -} arm_2d_cmp_t; - -/*----------------------------------------------------------------------------* - * Colour definitions * - *----------------------------------------------------------------------------*/ - -/*! - * \brief the colour type for gray8 (8bit gray scale) - * - */ -typedef union arm_2d_color_gray8_t { - uint8_t tValue; -} arm_2d_color_gray8_t; - -/*! - * \brief the colour type for rgb565 - * - */ -typedef union arm_2d_color_rgb565_t { - uint16_t tValue; - struct { - uint16_t u5B : 5; - uint16_t u6G : 6; - uint16_t u5R : 5; - }; -} arm_2d_color_rgb565_t; - -/*! - * \brief the colour type for brga8888 - * - * \details In most cases four equal-sized pieces of adjacent memory are used, - * one for each channel, and a 0 in a channel indicates black color or - * transparent alpha, while all-1 bits indicates white or fully opaque - * alpha. By far the most common format is to store 8 bits (one byte) - * for each channel, which is 32 bits for each pixel. - * - * (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32) - */ -typedef union arm_2d_color_bgra8888_t { - uint32_t tValue; - struct { - uint32_t u8B : 8; - uint32_t u8G : 8; - uint32_t u8R : 8; - uint32_t u8A : 8; - }; -} arm_2d_color_bgra8888_t; - -/*! - * \brief the colour type for rgb888 (compliant with ccca888 and bgra8888) - * - * \details In most cases four equal-sized pieces of adjacent memory are used, - * one for each channel, and a 0 in a channel indicates black color or - * transparent alpha, while all-1 bits indicates white or fully opaque - * alpha. By far the most common format is to store 8 bits (one byte) - * for each channel, which is 32 bits for each pixel. - * - * (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32) - */ -typedef union arm_2d_color_rgb888_t { - uint32_t tValue; - struct { - uint32_t u8B : 8; - uint32_t u8G : 8; - uint32_t u8R : 8; - uint32_t : 8; - }; -} arm_2d_color_rgb888_t; - -/*! - * \brief the colour type for any 32bit colour formats which has an alpha channel on its 3rd byte. - * - * \details In most cases four equal-sized pieces of adjacent memory are used, - * one for each channel, and a 0 in a channel indicates black color or - * transparent alpha, while all-1 bits indicates white or fully opaque - * alpha. By far the most common format is to store 8 bits (one byte) - * for each channel, which is 32 bits for each pixel. - * - * (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32) - */ -typedef union arm_2d_color_ccca8888_t { - uint32_t tValue; - struct { - uint8_t u8C[3]; - uint8_t u8A; - }; -} arm_2d_color_ccca8888_t; - -/*! - * \brief the colour type for any 32bit colour formats which has an alpha channel on its first byte. - * - * \details In most cases four equal-sized pieces of adjacent memory are used, - * one for each channel, and a 0 in a channel indicates black color or - * transparent alpha, while all-1 bits indicates white or fully opaque - * alpha. By far the most common format is to store 8 bits (one byte) - * for each channel, which is 32 bits for each pixel. - * - * (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32) - */ -typedef union arm_2d_color_accc8888_t { - uint32_t tValue; - struct { - uint8_t u8A; - uint8_t u8C[3]; - }; -} arm_2d_color_accc8888_t; - -/*! - * \brief the colour type for any 32bit colour formats which has an unused-alpha channel on its 3rd byte. - * - * \details In most cases four equal-sized pieces of adjacent memory are used, - * one for each channel, and a 0 in a channel indicates black color or - * transparent alpha, while all-1 bits indicates white or fully opaque - * alpha. By far the most common format is to store 8 bits (one byte) - * for each channel, which is 32 bits for each pixel. - * - * (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32) - */ -typedef union arm_2d_color_cccn888_t { - uint32_t tValue; - struct { - uint8_t u8C[3]; - uint8_t : 8; - }; -} arm_2d_color_cccn888_t; - -/*! - * \brief the colour type for any 32bit colour formats which has an unused-alpha channel on its first byte. - * - * \details In most cases four equal-sized pieces of adjacent memory are used, - * one for each channel, and a 0 in a channel indicates black color or - * transparent alpha, while all-1 bits indicates white or fully opaque - * alpha. By far the most common format is to store 8 bits (one byte) - * for each channel, which is 32 bits for each pixel. - * - * (source: https://en.wikipedia.org/wiki/RGBA_color_model#ARGB32) - */ -typedef union arm_2d_color_nccc888_t { - uint32_t tValue; - struct { - uint8_t : 8; - uint8_t u8C[3]; - }; -} arm_2d_color_nccc888_t; - -/*! - * \brief enumerations for colour attributes - */ -enum { - ARM_2D_COLOUR_SZ_1BIT = 0, //!< 1 bit:black and white - ARM_2D_COLOUR_SZ_2BIT = 1, //!< 4 colours or 4 gray-levels - ARM_2D_COLOUR_SZ_4BIT = 2, //!< 16 colours or 16 gray-levels - ARM_2D_COLOUR_SZ_8BIT = 3, //!< 256 colours - ARM_2D_COLOUR_SZ_16BIT = 4, //!< 16bits - ARM_2D_COLOUR_SZ_32BIT = 5, //!< true colour - - ARM_2D_COLOUR_SZ_1BIT_msk = ARM_2D_COLOUR_SZ_1BIT << 1, - ARM_2D_COLOUR_SZ_2BIT_msk = ARM_2D_COLOUR_SZ_2BIT << 1, - ARM_2D_COLOUR_SZ_4BIT_msk = ARM_2D_COLOUR_SZ_4BIT << 1, - ARM_2D_COLOUR_SZ_8BIT_msk = ARM_2D_COLOUR_SZ_8BIT << 1, - ARM_2D_COLOUR_SZ_16BIT_msk = ARM_2D_COLOUR_SZ_16BIT<< 1, - ARM_2D_COLOUR_SZ_32BIT_msk = ARM_2D_COLOUR_SZ_32BIT<< 1, - ARM_2D_COLOUR_SZ_msk = (0x07 << 1), - - ARM_2D_COLOUR_LITTLE_ENDIAN = 0, - ARM_2D_COLOUR_BIG_ENDIAN = 1, - - ARM_2D_COLOUR_LITTLE_ENDIAN_msk = ARM_2D_COLOUR_LITTLE_ENDIAN << 4, - ARM_2D_COLOUR_BIG_ENDIAN_msk = ARM_2D_COLOUR_BIG_ENDIAN << 4, - - ARM_2D_COLOUR_NO_ALPHA = 0, - ARM_2D_COLOUR_HAS_ALPHA = 1, - - ARM_2D_COLOUR_NO_ALPHA_msk = ARM_2D_COLOUR_NO_ALPHA << 0, - ARM_2D_COLOUR_HAS_ALPHA_msk = ARM_2D_COLOUR_HAS_ALPHA << 0, - - ARM_2D_COLOUR_VARIANT_pos = 5, - ARM_2D_COLOUR_VARIANT_msk = 0x07 << ARM_2D_COLOUR_VARIANT_pos, -}; - -/* macros for colour attributes */ -#define ARM_2D_M_COLOUR_SZ_1BIT 0 //!< 1 bit:black and white -#define ARM_2D_M_COLOUR_SZ_2BIT 1 //!< 4 colours or 4 gray-levels -#define ARM_2D_M_COLOUR_SZ_4BIT 2 //!< 16 colours or 16 gray-levels -#define ARM_2D_M_COLOUR_SZ_8BIT 3 //!< 256 colours -#define ARM_2D_M_COLOUR_SZ_16BIT 4 //!< 16bits -#define ARM_2D_M_COLOUR_SZ_32BIT 5 //!< true colour - -#define ARM_2D_M_COLOUR_SZ_1BIT_msk (ARM_2D_M_COLOUR_SZ_1BIT << 1) -#define ARM_2D_M_COLOUR_SZ_2BIT_msk (ARM_2D_M_COLOUR_SZ_2BIT << 1) -#define ARM_2D_M_COLOUR_SZ_4BIT_msk (ARM_2D_M_COLOUR_SZ_4BIT << 1) -#define ARM_2D_M_COLOUR_SZ_8BIT_msk (ARM_2D_M_COLOUR_SZ_8BIT << 1) -#define ARM_2D_M_COLOUR_SZ_16BIT_msk (ARM_2D_M_COLOUR_SZ_16BIT<< 1) -#define ARM_2D_M_COLOUR_SZ_32BIT_msk (ARM_2D_M_COLOUR_SZ_32BIT<< 1) -#define ARM_2D_M_COLOUR_SZ_msk (0x07 << 1), - -#define ARM_2D_M_COLOUR_LITTLE_ENDIAN 0 -#define ARM_2D_M_COLOUR_BIG_ENDIAN 1 - -#define ARM_2D_M_COLOUR_LITTLE_ENDIAN_msk (ARM_2D_M_COLOUR_LITTLE_ENDIAN << 4) -#define ARM_2D_M_COLOUR_BIG_ENDIAN_msk (ARM_2D_M_COLOUR_BIG_ENDIAN << 4) - -#define ARM_2D_M_COLOUR_NO_ALPHA 0 -#define ARM_2D_M_COLOUR_HAS_ALPHA 1 - -#define ARM_2D_M_COLOUR_NO_ALPHA_msk (ARM_2D_M_COLOUR_NO_ALPHA << 0) -#define ARM_2D_M_COLOUR_HAS_ALPHA_msk (ARM_2D_M_COLOUR_HAS_ALPHA << 0) - -#define ARM_2D_M_COLOUR_VARIANT_pos 5 -#define ARM_2D_M_COLOUR_VARIANT_msk (0x07 << ARM_2D_M_COLOUR_VARIANT_pos) - -/*! - * \brief enumerations for colour types - * - */ -enum { - ARM_2D_COLOUR_BIN = ARM_2D_COLOUR_SZ_1BIT_msk, - ARM_2D_COLOUR_1BIT = ARM_2D_COLOUR_SZ_1BIT_msk, - - ARM_2D_COLOUR_8BIT = ARM_2D_COLOUR_SZ_8BIT_msk, - ARM_2D_COLOUR_GRAY8 = ARM_2D_COLOUR_SZ_8BIT_msk, - - ARM_2D_COLOUR_16BIT = ARM_2D_COLOUR_SZ_16BIT_msk, - ARM_2D_COLOUR_RGB16 = ARM_2D_COLOUR_SZ_16BIT_msk, - ARM_2D_COLOUR_RGB565 = ARM_2D_COLOUR_RGB16, - -/* won't support - ARM_2D_COLOUR_RGB565_BE = ARM_2D_COLOUR_SZ_16BIT_msk | - ARM_2D_COLOUR_BIG_ENDIAN_msk , - */ - - ARM_2D_COLOUR_32BIT = ARM_2D_COLOUR_SZ_32BIT_msk , - ARM_2D_COLOUR_RGB32 = ARM_2D_COLOUR_SZ_32BIT_msk , - - ARM_2D_COLOUR_CCCN888 = ARM_2D_COLOUR_RGB32 , - ARM_2D_COLOUR_CCCA8888 = ARM_2D_COLOUR_SZ_32BIT_msk | - ARM_2D_COLOUR_HAS_ALPHA_msk , - - ARM_2D_COLOUR_RGB888 = ARM_2D_COLOUR_CCCN888 , - ARM_2D_COLOUR_BGRA8888 = ARM_2D_COLOUR_CCCA8888 , - -/* not supported yet - ARM_2D_COLOUR_NCCC888 = ARM_2D_COLOUR_RGB32 | - ARM_2D_COLOUR_BIG_ENDIAN_msk , - ARM_2D_COLOUR_ACCC8888 = ARM_2D_COLOUR_SZ_32BIT_msk | - ARM_2D_COLOUR_HAS_ALPHA_msk | - ARM_2D_COLOUR_BIG_ENDIAN_msk , -*/ - ARM_2D_CHANNEL_8in32 = ARM_2D_COLOUR_SZ_32BIT_msk | - ARM_2D_COLOUR_HAS_ALPHA_msk | - ARM_2D_COLOUR_VARIANT_msk , -}; - -/* macros for colour formats */ -#define ARM_2D_M_COLOUR_BIN ARM_2D_M_COLOUR_SZ_1BIT_msk -#define ARM_2D_M_COLOUR_1BIT ARM_2D_M_COLOUR_SZ_1BIT_msk - -#define ARM_2D_M_COLOUR_8BIT ARM_2D_M_COLOUR_SZ_8BIT_msk -#define ARM_2D_M_COLOUR_GRAY8 ARM_2D_M_COLOUR_SZ_8BIT_msk - -#define ARM_2D_M_COLOUR_16BIT ARM_2D_M_COLOUR_SZ_16BIT_msk -#define ARM_2D_M_COLOUR_RGB16 ARM_2D_M_COLOUR_SZ_16BIT_msk -#define ARM_2D_M_COLOUR_RGB565 ARM_2D_M_COLOUR_RGB16 - -/* won't support -#define ARM_2D_M_COLOUR_RGB565_BE ( ARM_2D_M_COLOUR_SZ_16BIT_msk \ - | ARM_2D_M_COLOUR_BIG_ENDIAN_msk ) - */ - -#define ARM_2D_M_COLOUR_32BIT ARM_2D_M_COLOUR_SZ_32BIT_msk -#define ARM_2D_M_COLOUR_RGB32 ARM_2D_M_COLOUR_SZ_32BIT_msk - -#define ARM_2D_M_COLOUR_CCCN888 ARM_2D_M_COLOUR_RGB32 -#define ARM_2D_M_COLOUR_CCCA8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \ - | ARM_2D_M_COLOUR_HAS_ALPHA_msk) - -#define ARM_2D_M_COLOUR_RGB888 ARM_2D_M_COLOUR_CCCN888 -#define ARM_2D_M_COLOUR_RGBA8888 ARM_2D_M_COLOUR_CCCA8888 - -/* not supported yet -#define ARM_2D_M_COLOUR_NCCC888 ( ARM_2D_M_COLOUR_RGB32 \ - | ARM_2D_M_COLOUR_BIG_ENDIAN_msk ) -#define ARM_2D_M_COLOUR_ACCC8888 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \ - | ARM_2D_M_COLOUR_HAS_ALPHA_msk \ - | ARM_2D_M_COLOUR_BIG_ENDIAN_msk ) -*/ -#define ARM_2D_M_CHANNEL_8in32 ( ARM_2D_M_COLOUR_SZ_32BIT_msk \ - | ARM_2D_M_COLOUR_HAS_ALPHA_msk) \ - | ARM_2D_M_COLOUR_VARIANT_msk ) - -/*! - * \brief a type used as colour descriptor - * - */ -typedef union { - struct { - uint8_t bHasAlpha : 1; //!< whether the target colour has alpha channel - uint8_t u3ColourSZ : 3; //!< the size of the colour - uint8_t bBigEndian : 1; //!< whether the colour is stored in big endian - uint8_t u3Variant : 3; - }; - uint8_t chScheme; -} arm_2d_color_info_t; - -/*----------------------------------------------------------------------------* - * Tile and Regions * - *----------------------------------------------------------------------------*/ - -/*! - * \brief a type for coordinates (integer) - * - */ -typedef struct arm_2d_location_t { - int16_t iX; //!< x in Cartesian coordinate system - int16_t iY; //!< y in Cartesian coordinate system -} arm_2d_location_t; - -/*! - * \brief a type for coordinates in floating point - * - */ -typedef struct arm_2d_point_float_t { - float fX; //!< x in Cartesian coordinate system - float fY; //!< y in Cartesian coordinate system -} arm_2d_point_float_t; - -/*! - * \brief a type for coordinates in fixed point - * - */ -typedef struct arm_2d_point_fx_t { - int32_t X; //!< x in Cartesian coordinate system - int32_t Y; //!< y in Cartesian coordinate system -} arm_2d_point_fx_t; - -/*! - * \brief a type for the size of an rectangular area - * - */ -typedef struct arm_2d_size_t { - int16_t iWidth; //!< width of an rectangular area - int16_t iHeight; //!< height of an rectangular area -} arm_2d_size_t; - -/*! - * \brief a type for an rectangular area - * - */ -typedef struct arm_2d_region_t { - implement_ex(arm_2d_location_t, tLocation); //!< the location (top-left corner) - implement_ex(arm_2d_size_t, tSize); //!< the size -} arm_2d_region_t; - -/*! - * \brief a type for tile - * - */ -typedef struct arm_2d_tile_t arm_2d_tile_t; -struct arm_2d_tile_t { - implement_ex(struct { - uint8_t bIsRoot : 1; //!< is this tile a root tile - uint8_t bHasEnforcedColour : 1; //!< does this tile contains enforced colour info - uint8_t bDerivedResource : 1; //!< indicate whether this is a derived resources (when bIsRoot == 0) - uint8_t bVirtualResource : 1; //!< indicate whether the resource should be loaded on-demand - uint8_t : 4; - uint8_t : 8; - uint8_t : 8; - arm_2d_color_info_t tColourInfo; //!< enforced colour - }, tInfo); - - implement_ex(arm_2d_region_t, tRegion); //!< the region of the tile - - union { - /* when bIsRoot is true, phwBuffer is available, - * otherwise ptParent is available - */ - arm_2d_tile_t *ptParent; //!< a pointer points to the parent tile - uint8_t *pchBuffer; //!< a pointer points to a buffer in a 8bit colour type - uint16_t *phwBuffer; //!< a pointer points to a buffer in a 16bit colour type - uint32_t *pwBuffer; //!< a pointer points to a buffer in a 32bit colour type - - intptr_t nAddress; //!< a pointer in integer - }; -}; - -/*! - * \brief a type for virtual resource - * - * \note the flag tTile.tInfo.bVirtualResource must be true (1) - */ -typedef struct arm_2d_vres_t arm_2d_vres_t; -struct arm_2d_vres_t { - - /*! base class: tTile */ - implement_ex( arm_2d_tile_t, tTile); - - /*! a reference of an user object */ - uintptr_t pTarget; - - /*! - * \brief a method to load a specific part of an image - * \param[in] pTarget a reference of an user object - * \param[in] ptVRES a reference of this virtual resource - * \param[in] ptRegion the target region of the image - * \return intptr_t the address of a resource buffer which holds the content - */ - intptr_t (*Load) ( uintptr_t pTarget, - arm_2d_vres_t *ptVRES, - arm_2d_region_t *ptRegion); - - /*! - * \brief a method to despose the buffer - * \param[in] pTarget a reference of an user object - * \param[in] ptVRES a reference of this virtual resource - * \param[in] pBuffer the target buffer - */ - void (*Depose) ( uintptr_t pTarget, - arm_2d_vres_t *ptVRES, - intptr_t pBuffer ); -}; - -/*----------------------------------------------------------------------------* - * Task * - *----------------------------------------------------------------------------*/ - -/*! - * \brief arm-2d application level task control block - * - */ -typedef struct arm_2d_task_t { -ARM_PRIVATE( - arm_fsm_rt_t tResult; //!< the temporary result of the task - uint8_t chState; //!< the state of the FSM - - void *ptTask; //!< a pointer for an internal object -) -} arm_2d_task_t; - -/*----------------------------------------------------------------------------* - * Operation and Events Handling * - *----------------------------------------------------------------------------*/ - - -typedef struct arm_2d_op_core_t arm_2d_op_core_t; - -/*! - * \brief a prototype of event handlers for 2D operations - * - * \param[in] ptThisOP the target 2D operation descriptor - * \param[in] tResult the operation result - * \param[in] pTarget A user attached object - * \return bool a boolean value to indicate whether the event has been handled - */ -typedef bool arm_2d_op_evt_handler_t( arm_2d_op_core_t *ptThisOP, - arm_fsm_rt_t tResult, - void *pTarget); - -/*! - * \brief a type for 2D operation event handling - * - */ -typedef struct arm_2d_op_evt_t { - arm_2d_op_evt_handler_t *fnHandler; //!< event handler - void *pTarget; //!< user attached target -} arm_2d_op_evt_t; - -/*! - * \brief a prototype for generic event handlers - * - * \param pTarget A user attached object - * \return bool a boolean value to indicate whether the event has been handled - */ -typedef bool arm_2d_evt_handler_t(void *pTarget); - -/*! - * \brief a type for generic event handling - * - */ -typedef struct arm_2d_evt_t { - arm_2d_evt_handler_t *fnHandler; //!< event handler - void *pTarget; //!< user attached target -} arm_2d_evt_t; - - -#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE _BV(0) -#define ARM_2D_OP_INFO_PARAM_HAS_TARGET _BV(1) -#define ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK _BV(2) -#define ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK _BV(3) -#define ARM_2D_OP_INFO_PARAM_HAS_ORIGIN _BV(4) - -#define ARM_2D_OP_INFO_PARAM_TILES_MASK ( \ - ARM_2D_OP_INFO_PARAM_HAS_SOURCE | \ - ARM_2D_OP_INFO_PARAM_HAS_TARGET | \ - ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK | \ - ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK | \ - ARM_2D_OP_INFO_PARAM_HAS_ORIGIN ) - - -//! \brief an incomplete defintion which is only used for defining pointers -typedef struct __arm_2d_low_level_io_t __arm_2d_low_level_io_t; - -/*! - * \brief A descriptive header for 2D operations - */ -typedef union __arm_2d_op_info_t { - struct { - arm_2d_color_info_t Colour; //!< the colour used in thie operation - union { - struct { - uint8_t bHasSource : 1; //!< whether this operation contains source tile - uint8_t bHasTarget : 1; //!< whether this operation contains target tile - uint8_t bHasSrcMask : 1; //!< whether this operation has Mask layer for source tile - uint8_t bHasDesMask : 1; //!< whether this operation has Mask layer for target tile - uint8_t bHasOrigin : 1; //!< whether the Source has an origin tile - uint8_t : 2; - uint8_t bAllowEnforcedColour : 1; //!< whether this operation allow enforced colours in tiles - }; - uint8_t chValue; //!< feature value - }Param; //!< operation feature set - - uint8_t chInClassOffset; //!< some operation uses this as the offset of the key member in the class - uint8_t chOpIndex; //!< __ARM_2D_OP_IDX_XXXXXX - - union { - struct { - uint8_t CopyLike; //!< A copy-like interface contains the target tile, the source tile and the copy size - uint8_t FillLike; //!< A copy-like interface contains the target tile and the source tile - }; - struct { - uint8_t CopyOrigLike; //!< A copy-like interface contains the target tile, the dummy tile, the reference to the original source tile and the copy size - uint8_t FillOrigLike; //!< A copy-like interface contains the target tile, the dummy tile and the reference to the original source tile - }; - struct { - uint8_t TileProcessLike; //!< A simple interface contains only the target tile - }; - }LowLevelInterfaceIndex; //!< Low level interface index - - union { - const __arm_2d_low_level_io_t *IO[2]; //!< array of IOs - - struct { - const __arm_2d_low_level_io_t *ptCopyLike; //!< the function pointer for a copy-like implementation - const __arm_2d_low_level_io_t *ptFillLike; //!< the function pointer for a fill-like implementation - }; - struct { - const __arm_2d_low_level_io_t *ptCopyOrigLike; //!< the function pointer for a copy-orig-like implementation - const __arm_2d_low_level_io_t *ptFillOrigLike; //!< the function pointer for a fill-orig-like implementation - }; - struct { - const __arm_2d_low_level_io_t *ptTileProcessLike; //!< the function pointer for the tile-process-like implementation - }; - }LowLevelIO; //!< low level IO definition - - }Info; //!< operation description - uint32_t wID; //!< Operation ID -} __arm_2d_op_info_t; - -/*! - * \brief how would you want to accelerate the 2d-operation - */ -enum { - //! Use hardware acceleration if possible, even if there is a long queue to wait - ARM_2D_PREF_ACC_USE_HW_IF_POSSIBLE = 0, - - //! Only use Hardware Acceleration, if it is not supported, IO error will be issued - ARM_2D_PREF_ACC_HW_ONLY = 1, - - //! Only use software algorithm - ARM_2D_PREF_ACC_SW_ONLY = 2, - - //!< don't care, let the arm-2d library decide - ARM_2D_PREF_ACC_DONT_CARE = 3, -}; - -#define __ARM_2D_OP_STATUS_BUSY_msk (1 << 4) -#define __ARM_2D_OP_STATUS_IO_ERROR_msk (1 << 5) -#define __ARM_2D_OP_STATUS_CPL_msk (1 << 6) - -/*! - * \brief a type for 2D operation status - * - */ -typedef union arm_2d_op_status_t { - struct { - uint16_t u4SubTaskCount : 4; //!< sub task count - uint16_t bIsBusy : 1; //!< busy flag - uint16_t bIOError : 1; //!< HW IO Error - uint16_t bOpCpl : 1; //!< the whole operation complete - uint16_t : 9; //!< reserved - }; - uint16_t tValue; //!< the host integer -} arm_2d_op_status_t; - -/*! - * \brief the abstract class of 2D operations - * - */ -struct arm_2d_op_core_t { -ARM_PRIVATE( - arm_2d_op_core_t *ptNext; //!< a pointer for a single list - - const __arm_2d_op_info_t *ptOp; //!< the pointer for the corresponding 2D operation description - - struct { - uint8_t u2ACCMethods : 2; //!< acceleration Methods - uint8_t : 6; //!< reserved - }Preference; - - int8_t tResult; //!< operation result - volatile arm_2d_op_status_t Status; //!< operation status - - arm_2d_op_evt_t evt2DOpCpl; //!< operation-complete event - -) - uintptr_t pUserParam; //!< user attached object -}; - -/*! - * \brief the base class for operations with only a target tile - * \note arm_2d_op_msk_t inherits from arm_2d_op_core_t - */ -typedef struct arm_2d_op_t { - inherit(arm_2d_op_core_t); - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; -} arm_2d_op_t; - -/*! - * \brief the base class for operations with a target tile and a target mask - * \note arm_2d_op_msk_t inherits from arm_2d_op_t - */ -typedef struct arm_2d_op_msk_t { - inherit(arm_2d_op_core_t); - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - - /* derived part */ - struct { - const arm_2d_tile_t *ptTile; //!< target tile - } Mask; -} arm_2d_op_msk_t; - -/*! - * \brief the base class for operations with a target tile and a source tile - * \note arm_2d_op_src_t inherits from arm_2d_op_t - */ -typedef struct arm_2d_op_src_t { - inherit(arm_2d_op_core_t); - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - - /* derived part */ - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; -} arm_2d_op_src_t; - -/*! - * \brief the base class for operations with a target tile, a source tile and masks - * \note arm_2d_op_src_msk_t inherits from arm_2d_op_src_t - */ -typedef struct arm_2d_op_src_msk_t { - inherit(arm_2d_op_core_t); - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< source tile - }Source; - uint32_t wMode; - - /* derived part */ - struct { - const arm_2d_tile_t *ptSourceSide; //!< source side mask - const arm_2d_tile_t *ptTargetSide; //!< target side mask - } Mask; -} arm_2d_op_src_msk_t; - -/*! - * \brief the base class for operations with a target tile, a dummy tile and a reference to the original source tile - * \note arm_2d_op_src_orig_t inherits from arm_2d_op_src_t - */ -typedef struct arm_2d_op_src_orig_t { - inherit(arm_2d_op_core_t); - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< the dummy source tile - }Source; - uint32_t wMode; - - /* derived part */ - struct { - const arm_2d_tile_t *ptTile; //!< the origin tile - arm_2d_tile_t tDummySource; //!< the buffer for the source - }Origin; - -} arm_2d_op_src_orig_t; - -/*! - * \brief the base class for operations with a target tile, a dummy tile, a reference to the original source tile and masks - * \note arm_2d_op_src_orig_msk_t inherits from arm_2d_op_src_orig_t - */ -typedef struct arm_2d_op_src_orig_msk_t { - inherit(arm_2d_op_core_t); - struct { - const arm_2d_tile_t *ptTile; //!< target tile - const arm_2d_region_t *ptRegion; //!< target region - } Target; - struct { - const arm_2d_tile_t *ptTile; //!< the dummy source tile - }Source; - uint32_t wMode; - struct { - const arm_2d_tile_t *ptTile; //!< the origin tile - arm_2d_tile_t tDummySource; //!< the buffer for the source - }Origin; - - /* derived part */ - struct { - const arm_2d_tile_t *ptOriginSide; //!< origin side mask - const arm_2d_tile_t *ptTargetSide; //!< target side mask - } Mask; -} arm_2d_op_src_orig_msk_t; - - -/*----------------------------------------------------------------------------* - * Fast Rotation linear regression structure - *----------------------------------------------------------------------------*/ - -#if (__ARM_2D_HAS_HELIUM_FLOAT__ || __ARM_2D_HAS_FPU__) \ - && !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ -/*! - * \brief a type for parameters of linear interpolation (in floating point) - * - */ -typedef struct arm_2d_rot_linear_regr_t { - float slopeY; - float interceptY; - float slopeX; - float interceptX; -} arm_2d_rot_linear_regr_t; - -#else -/*! - * \brief a type for parameters of linear interpolation (in fixed point) - * - */ -typedef struct arm_2d_rot_linear_regr_t { - int32_t slopeY; - int32_t interceptY; - int32_t slopeX; - int32_t interceptX; -} arm_2d_rot_linear_regr_t; - -#endif - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -/*! @} */ - -#if defined(__clang__) -#pragma clang diagnostic pop -#elif __IS_COMPILER_ARM_COMPILER_5__ -#pragma diag_warning 64 -#elif __IS_COMPILER_GCC__ -#pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif // __ARM_2D_TYPES_H__ - - diff --git a/package/Arm2D/Library/Include/arm_2d_utils.h b/package/Arm2D/Library/Include/arm_2d_utils.h deleted file mode 100644 index 57b7a18bf..000000000 --- a/package/Arm2D/Library/Include/arm_2d_utils.h +++ /dev/null @@ -1,571 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm_2d_utils.h - * Description: Public header file for Arm-2D Library - * - * $Date: 18. July 2022 - * $Revision: V.1.0.3 - * - * -------------------------------------------------------------------- */ - -#ifndef __ARM_2D_UTILS_H__ -#define __ARM_2D_UTILS_H__ - -/*============================ INCLUDES ======================================*/ - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" -# pragma clang diagnostic ignored "-Wundef" -#elif defined(__IS_COMPILER_GCC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -#ifdef __ARM_2D_HAS_USER_HEADER__ -# include __ARM_2D_HAS_USER_HEADER__ -#endif - -/*! \note arm-2d relies on CMSIS 5.4.0 and above. - */ -#include "cmsis_compiler.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*! - * \addtogroup gKernel 1 Kernel - * @{ - */ - -/*============================ MACROS ========================================*/ - - -/*----------------------------------------------------------------------------* - * Environment Detection * - *----------------------------------------------------------------------------*/ - -/* The macros to identify compilers */ - -/*! - * \brief to detect IAR - */ -#undef __IS_COMPILER_IAR__ -#if defined(__IAR_SYSTEMS_ICC__) -# define __IS_COMPILER_IAR__ 1 -#endif - -/*! - * \brief to detect arm compiler 5 - * - */ -#undef __IS_COMPILER_ARM_COMPILER_5__ -#if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000)) -# define __IS_COMPILER_ARM_COMPILER_5__ 1 -#endif - - -/*! - * \brief to detect arm compiler 6 - * - */ -#undef __IS_COMPILER_ARM_COMPILER_6__ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -# define __IS_COMPILER_ARM_COMPILER_6__ 1 -#endif - -/*! - * \brief to detect arm compilers - * - */ -#undef __IS_COMPILER_ARM_COMPILER__ -#if defined(__IS_COMPILER_ARM_COMPILER_5__) && __IS_COMPILER_ARM_COMPILER_5__ \ -|| defined(__IS_COMPILER_ARM_COMPILER_6__) && __IS_COMPILER_ARM_COMPILER_6__ -# define __IS_COMPILER_ARM_COMPILER__ 1 -#endif - -/*! - * \brief to detect clang (llvm) - * - */ -#undef __IS_COMPILER_LLVM__ -#if defined(__clang__) && !__IS_COMPILER_ARM_COMPILER_6__ -# define __IS_COMPILER_LLVM__ 1 -#else - -/*! - * \brief to detect gcc - * - */ -# undef __IS_COMPILER_GCC__ -# if defined(__GNUC__) && !( defined(__IS_COMPILER_ARM_COMPILER__) \ - || defined(__IS_COMPILER_LLVM__) \ - || defined(__IS_COMPILER_IAR__)) -# define __IS_COMPILER_GCC__ 1 -# endif - -#endif - - - -/*----------------------------------------------------------------------------* - * OOC and Private Protection * - *----------------------------------------------------------------------------*/ -/* minimal support for OOPC */ -#undef __implement_ex -#undef __implement -#undef implement -#undef implement_ex -#undef inherit -#undef inherit_ex - -#define __implement_ex(__type, __name) \ - union { \ - __type __name; \ - __type; \ - } - -#define __inherit_ex(__type, __name) \ - __type __name \ - -#define __implement(__type) __implement_ex( __type, \ - use_as__##__type) - -#define __inherit(__type) __inherit_ex(__type,use_as__##__type) - -#define implement(__type) __implement(__type) -#define implement_ex(__type, __name) __implement_ex(__type, __name) - -#define inherit(__type) __inherit(__type) -#define inherit_ex(__type, __name) __inherit_ex(__type, __name) - - -/*----------------------------------------------------------------------------* - * Misc * - *----------------------------------------------------------------------------*/ - -#ifndef ARM_2D_UNUSED -# define ARM_2D_UNUSED(__VAR) (void)(__VAR) -#endif - -#ifndef ARM_TEST_BITS -# define ARM_TEST_BITS(__VALUE, __BITS) ((__BITS) == ((__VALUE) & (__BITS))) -#endif - -#ifndef dimof -# define dimof(__array) (sizeof(__array)/sizeof(__array[0])) -#endif - -#ifndef offsetof -# define offsetof(__type, __member) \ - ((uintptr_t)&(((__type *)NULL)->__member)) -#endif - -#define __ARM_TO_STRING(__STR) #__STR -#define ARM_TO_STRING(__STR) __ARM_TO_STRING(__STR) - -#define __ARM_VA_NUM_ARGS_IMPL( _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, \ - _13,_14,_15,_16,__N,...) __N - -/*! - * \brief A macro to count the number of parameters - * - * \note if GNU extension is not supported or enabled, the following express will - * be false: (__ARM_VA_NUM_ARGS() != 0) - * This might cause problems when in this library. - */ -#define __ARM_VA_NUM_ARGS(...) \ - __ARM_VA_NUM_ARGS_IMPL( 0,##__VA_ARGS__,16,15,14,13,12,11,10,9, \ - 8,7,6,5,4,3,2,1,0) - -/*! - * \brief detect whether GNU extension is enabled in compilation or not - */ -#if __ARM_VA_NUM_ARGS() != 0 -# warning Please enable GNU extensions, it is required by the Arm-2D. -#endif - -#ifndef ARM_2D_INVOKE -/*! - * \brief A macro to safely invode a function pointer - * - * \param[in] __FUNC_PTR the target function pointer - * \param[in] ... an optional parameter list - */ -# define ARM_2D_INVOKE(__FUNC_PTR, ...) \ - do { \ - if (NULL != (__FUNC_PTR)) { \ - (*(__FUNC_PTR))(__VA_ARGS__); \ - } \ - } while(0) -#endif - -#define __ARM_CONNECT2(__A, __B) __A##__B -#define __ARM_CONNECT2_ALT(__A, __B) __A##__B -#define __ARM_CONNECT3(__A, __B, __C) __A##__B##__C -#define __ARM_CONNECT4(__A, __B, __C, __D) __A##__B##__C##__D -#define __ARM_CONNECT5(__A, __B, __C, __D, __E) __A##__B##__C##__D##__E -#define __ARM_CONNECT6(__A, __B, __C, __D, __E, __F) \ - __A##__B##__C##__D##__E##__F -#define __ARM_CONNECT7(__A, __B, __C, __D, __E, __F, __G) \ - __A##__B##__C##__D##__E##__F##__G -#define __ARM_CONNECT8(__A, __B, __C, __D, __E, __F, __G, __H) \ - __A##__B##__C##__D##__E##__F##__G##__H -#define __ARM_CONNECT9(__A, __B, __C, __D, __E, __F, __G, __H, __I) \ - __A##__B##__C##__D##__E##__F##__G##__H##__I - -#define ARM_CONNECT2(__A, __B) __ARM_CONNECT2(__A, __B) -#define ARM_CONNECT2_ALT(__A, __B) __ARM_CONNECT2_ALT(__A, __B) -#define ARM_CONNECT3(__A, __B, __C) __ARM_CONNECT3(__A, __B, __C) -#define ARM_CONNECT4(__A, __B, __C, __D) __ARM_CONNECT4(__A, __B, __C, __D) -#define ARM_CONNECT5(__A, __B, __C, __D, __E) \ - __ARM_CONNECT5(__A, __B, __C, __D, __E) -#define ARM_CONNECT6(__A, __B, __C, __D, __E, __F) \ - __ARM_CONNECT6(__A, __B, __C, __D, __E, __F) -#define ARM_CONNECT7(__A, __B, __C, __D, __E, __F, __G) \ - __ARM_CONNECT7(__A, __B, __C, __D, __E, __F, __G) -#define ARM_CONNECT8(__A, __B, __C, __D, __E, __F, __G, __H) \ - __ARM_CONNECT8(__A, __B, __C, __D, __E, __F, __G, __H) -#define ARM_CONNECT9(__A, __B, __C, __D, __E, __F, __G, __H, __I) \ - __ARM_CONNECT9(__A, __B, __C, __D, __E, __F, __G, __H, __I) - -#define arm_connect(...) \ - ARM_CONNECT2_ALT(ARM_CONNECT, __ARM_VA_NUM_ARGS(__VA_ARGS__)) \ - (__VA_ARGS__) - -#define ARM_CONNECT(...) arm_connect(__VA_ARGS__) - -#define __ARM_USING1(__declare) \ - for (__declare, *ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr) = NULL; \ - ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr)++ == NULL; \ - ) - -#define __ARM_USING2(__declare, __on_leave_expr) \ - for (__declare, *ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr) = NULL; \ - ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr)++ == NULL; \ - __on_leave_expr \ - ) - -#define __ARM_USING3(__declare, __on_enter_expr, __on_leave_expr) \ - for (__declare, *ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr) = NULL; \ - ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr)++ == NULL ? \ - ((__on_enter_expr),1) : 0; \ - __on_leave_expr \ - ) - -#define __ARM_USING4(__dcl1, __dcl2, __on_enter_expr, __on_leave_expr) \ - for (__dcl1,__dcl2,*ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr)= NULL;\ - ARM_CONNECT3(__ARM_USING_, __LINE__,_ptr)++ == NULL ? \ - ((__on_enter_expr),1) : 0; \ - __on_leave_expr \ - ) - -#define arm_using(...) \ - ARM_CONNECT2(__ARM_USING, __ARM_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) - - -#define __ARM_WITH2(__type, __addr) \ - ARM_USING(__type *_p=(__addr)) -#define __ARM_WITH3(__type, __addr, __item) \ - ARM_USING(__type *_p=(__addr), *__item = _p, _p=_p, ) - -#define arm_with(...) \ - ARM_CONNECT2(__ARM_WITH, __ARM_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) - -#define ARM_FOREACH2(__type, __array) \ - arm_using(__type *_ = __array) \ - for ( uint_fast32_t ARM_CONNECT2(count,__LINE__) = dimof(__array);\ - ARM_CONNECT2(count,__LINE__) > 0; \ - _++, ARM_CONNECT2(count,__LINE__)-- \ - ) - -#define ARM_FOREACH3(__type, __array, __item) \ - arm_using(__type *_ = __array, *__item = _, _ = _, ) \ - for ( uint_fast32_t ARM_CONNECT2(count,__LINE__) = dimof(__array);\ - ARM_CONNECT2(count,__LINE__) > 0; \ - _++, __item = _, ARM_CONNECT2(count,__LINE__)-- \ - ) - -#define ARM_FOREACH4(__type, __array, __count, __item) \ - arm_using(__type *_ = __array, *__item = _, _ = _, ) \ - for ( uint_fast32_t ARM_CONNECT2(count,__LINE__) = (__count); \ - ARM_CONNECT2(count,__LINE__) > 0; \ - _++, __item = _, ARM_CONNECT2(count,__LINE__)-- \ - ) - -#define arm_foreach(...) \ - ARM_CONNECT2(ARM_FOREACH, __ARM_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) - - -#ifndef ARM_NONNULL -# if defined(__IS_COMPILER_ARM_COMPILER_5__) ||\ - defined(__IS_COMPILER_ARM_COMPILER_6__) ||\ - defined(__IS_COMPILER_GCC__) ||\ - defined(__IS_COMPILER_LLVM__) -# define ARM_NONNULL(...) __attribute__((nonnull(__VA_ARGS__))) -# else -# define ARM_NONNULL(...) -# endif -#endif - -#ifndef ARM_NOINIT -# if defined(__IS_COMPILER_ARM_COMPILER_5__) -# define ARM_NOINIT __attribute__(( section( ".bss.noinit"),zero_init)) -# elif defined(__IS_COMPILER_ARM_COMPILER_6__) -# define ARM_NOINIT __attribute__(( section( ".bss.noinit"))) -# elif defined(__IS_COMPILER_IAR__) -# define ARM_NOINIT __no_init -# elif defined(__IS_COMPILER_GCC__) || defined(__IS_COMPILER_LLVM__) -# define ARM_NOINIT __attribute__(( section( ".bss.noinit"))) -# else -# define ARM_NOINIT -# endif -#endif - - -#ifndef ARM_ALIGN -# define __ARM_ALIGN(__N) __attribute__((aligned(__N))) -# define ARM_ALIGN(__N) __ARM_ALIGN(__N) -#endif - - -#ifndef __RESTRICT -# define __RESTRICT __restrict -#endif - -#ifndef __OVERRIDE_WEAK -# define __OVERRIDE_WEAK -#endif - -/*! - * \brief A macro to generate a safe name, usually used in macro template as the - * name of local variables - * - */ -#define ARM_2D_SAFE_NAME(...) ARM_CONNECT(__,__LINE__,##__VA_ARGS__) -#define arm_2d_safe_name(...) ARM_2D_SAFE_NAME(__VA_ARGS__) - -#undef arm_irq_safe - -/*! - * \brief a decoration to make the immediate following code irq-safe - * - * \code - arm_irq_safe { - // code inside the brackets are IRQ safe - ... - } - - // the printf is IRQ safe - arm_irq_safe printf("IRQ safe printf\n"); - - \endcode - */ -#define arm_irq_safe \ - arm_using( uint32_t ARM_2D_SAFE_NAME(temp) = \ - ({uint32_t temp=__get_PRIMASK();__disable_irq();temp;}),\ - __set_PRIMASK(ARM_2D_SAFE_NAME(temp))) - - -#undef ARM_2D_WRAP_FUNC -#undef __ARM_2D_WRAP_FUNC -#undef ARM_2D_ORIG_FUNC -#undef __ARM_2D_ORIG_FUNC - -#if defined(__IS_COMPILER_ARM_COMPILER_6__) -# define __ARM_2D_WRAP_FUNC(__FUNC) $Sub$$##__FUNC -# define __ARM_2D_ORIG_FUNC(__FUNC) $Super$$## __FUNC -#else -# define __ARM_2D_WRAP_FUNC(x) __wrap_ ## x -# define __ARM_2D_ORIG_FUNC(x) __real_ ## x -#endif - -#define ARM_2D_WRAP_FUNC(__FUNC) __ARM_2D_WRAP_FUNC(__FUNC) -#define ARM_2D_ORIG_FUNC(__FUNC) __ARM_2D_ORIG_FUNC(__FUNC) - -/*----------------------------------------------------------------------------* - * List Operations * - *----------------------------------------------------------------------------*/ - -/* ALL the parameters passed to following macros must be pointer variables. */ - -#define __ARM_LIST_STACK_PUSH(__P_TOP, __P_NODE) \ - do { \ - ((__arm_slist_node_t *)(__P_NODE))->ptNext = \ - (__arm_slist_node_t *)(__P_TOP); \ - (*(__arm_slist_node_t **)&(__P_TOP)) = \ - (__arm_slist_node_t *)(__P_NODE); \ - } while(0) -#define ARM_LIST_STACK_PUSH(__P_TOP, __P_NODE) \ - __ARM_LIST_STACK_PUSH((__P_TOP), (__P_NODE)) -#define ARM_LIST_INSERT_AFTER(__P_TARGET, __P_NODE) \ - __ARM_LIST_STACK_PUSH((__P_TARGET), (__P_NODE)) - -#define __ARM_LIST_STACK_POP(__P_TOP, __P_NODE) \ - do { \ - (*(__arm_slist_node_t **)&(__P_NODE)) = \ - (__arm_slist_node_t *)(__P_TOP); \ - if (NULL != (__P_TOP)) { \ - (*(__arm_slist_node_t **)&(__P_TOP)) = \ - ((__arm_slist_node_t *)(__P_NODE))->ptNext; \ - ((__arm_slist_node_t *)(__P_NODE))->ptNext = NULL; \ - } \ - } while(0) -#define ARM_LIST_STACK_POP(__P_TOP, __P_NODE) \ - __ARM_LIST_STACK_POP((__P_TOP), (__P_NODE)) -#define ARM_LIST_REMOVE_AFTER(__P_TARGET, __P_NODE) \ - ARM_LIST_STACK_POP((__P_TARGET), (__P_NODE)) - - -#define __ARM_LIST_QUEUE_ENQUEUE(__HEAD, __TAIL, __ITEM) \ - do { \ - if (NULL == (__TAIL)) { \ - (*((__arm_slist_node_t **)&(__TAIL))) = \ - (__arm_slist_node_t *)(__ITEM); \ - (*((__arm_slist_node_t **)&(__HEAD))) = \ - (__arm_slist_node_t *)(__ITEM); \ - } else { \ - ((__arm_slist_node_t *)(__TAIL))->ptNext = \ - (__arm_slist_node_t *)(__ITEM); \ - (*(__arm_slist_node_t **)&(__TAIL)) = \ - (__arm_slist_node_t *)(__ITEM); \ - } \ - ((__arm_slist_node_t *)(__ITEM))->ptNext = NULL; \ - } while(0) -#define ARM_LIST_QUEUE_ENQUEUE(__HEAD, __TAIL, __ITEM) \ - __ARM_LIST_QUEUE_ENQUEUE((__HEAD), (__TAIL), (__ITEM)) - -#define __ARM_LIST_QUEUE_DEQUEUE(__HEAD, __TAIL, __ITEM) \ - do { \ - (*(__arm_slist_node_t **)&(__ITEM)) = (__arm_slist_node_t *)(__HEAD); \ - if (NULL != (__HEAD)) { \ - (*(__arm_slist_node_t **)&(__HEAD)) = \ - ((__arm_slist_node_t *)(__HEAD))->ptNext; \ - if (NULL == (__HEAD)) { \ - (__TAIL) = NULL; \ - } \ - } \ - } while(0) - -#define ARM_LIST_QUEUE_DEQUEUE(__HEAD, __TAIL, __ITEM) \ - __ARM_LIST_QUEUE_DEQUEUE((__HEAD), (__TAIL), (__ITEM)) - -#define __ARM_LIST_QUEUE_PEEK(__HEAD, __TAIL, __ITEM) \ - do { \ - (*(__arm_slist_node_t **)&(__ITEM)) = (__arm_slist_node_t *)(__HEAD); \ - } while(0) -#define ARM_LIST_QUEUE_PEEK(__HEAD, __TAIL, __ITEM) \ - __ARM_LIST_QUEUE_PEEK((__HEAD), (__TAIL), (__ITEM)) \ - -/*----------------------------------------------------------------------------* - * Definition Template * - *----------------------------------------------------------------------------*/ - -#define __def_low_lv_io(__NAME, __SW, ...) \ -const __arm_2d_low_level_io_t LOW_LEVEL_IO##__NAME = { \ - .SW = (__arm_2d_io_func_t *)&(__SW), \ - .HW = (NULL, ##__VA_ARGS__) \ -} -#define def_low_lv_io(__NAME, __SW, ...) \ - __def_low_lv_io(__NAME, __SW, ##__VA_ARGS__) - - -#define __ref_low_lv_io(__NAME) &LOW_LEVEL_IO##__NAME -#define ref_low_lv_io(__NAME) __ref_low_lv_io(__NAME) - -/*============================ TYPES =========================================*/ - -/*! - * \brief a type for generic list - * - * \note to avoid using container_of() operand, please put __arm_slist_node_t - * at the beginning of a class/structure - */ -typedef struct __arm_slist_node_t __arm_slist_node_t; -struct __arm_slist_node_t { - __arm_slist_node_t *ptNext; //!< the next node -}; - - -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -#if defined(__clang__) -# pragma clang diagnostic pop -#elif __IS_COMPILER_ARM_COMPILER_5__ -#elif __IS_COMPILER_GCC__ -# pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* end of __ARM_2D_UTILS_H__ */ - - -/*! @} */ - -/*============================ MACROS ========================================*/ -/*----------------------------------------------------------------------------* - * Reentrant Macros * - *----------------------------------------------------------------------------*/ - -/* un-define macros */ -#undef ARM_PRIVATE - - -/* redefine macros */ -#if defined(__cplusplus) -# define ARM_PRIVATE(...) \ - struct { \ - __VA_ARGS__ \ - }; - -#elif defined(__ARM_2D_IMPL__) || defined(__IS_COMPILER_IAR__) - -# define ARM_PRIVATE(...) \ - struct { \ - __VA_ARGS__ \ - } __ALIGNED(__alignof__(struct {__VA_ARGS__})); - -#else -# define ARM_PRIVATE(...) \ - uint8_t ARM_CONNECT3(chMask,__LINE__,__COUNTER__) \ - [sizeof(struct {__VA_ARGS__})] \ - __ALIGNED(__alignof__(struct {__VA_ARGS__})); -#endif - - - - -/* post un-define macros */ - -#undef __ARM_2D_IMPL__ - diff --git a/package/Arm2D/Library/Source/__arm_2d_alpha_blending.inc b/package/Arm2D/Library/Source/__arm_2d_alpha_blending.inc deleted file mode 100644 index 44f6924d6..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_alpha_blending.inc +++ /dev/null @@ -1,354 +0,0 @@ - -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_alpha_blending.inc - * Description: c code template for drawing pattern - * - * $Date: 08. Sept 2021 - * $Revision: V.1.1.0 - * - * -------------------------------------------------------------------- */ - - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_INT_TYPE -# error You have to define the __API_INT_TYPE before using this c template -#endif -#ifndef __API_PIXEL_BLENDING -# error You have to define __API_PIXEL_BLENDING before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __arm_2d_impl_##__COLOUR##_##__NAME -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - -#ifndef __PATCH_ALPHA_BLENDING -__WEAK -void __ARM_2D_FUNC(alpha_blending) (__API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint_fast16_t hwRatio) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - uint16_t hwRatioCompl = 256 - hwRatio; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - __API_PIXEL_BLENDING(pSourceBase++, pTargetBase++, hwRatioCompl); - } - - pSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - } - -} -#else -extern -void __ARM_2D_FUNC(alpha_blending) (__API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint_fast16_t hwRatio); -#endif - - - -#ifndef __PATCH_ALPHA_BLENDING_COLOUR_MASKING -__WEAK -void __ARM_2D_FUNC(alpha_blending_colour_keying)( - __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint_fast16_t hwRatio, - __API_INT_TYPE Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - uint16_t hwRatioCompl = 256 - hwRatio; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - - if (*pSourceBase != Colour) { - __API_PIXEL_BLENDING( pSourceBase, pTargetBase, hwRatioCompl); - } - pSourceBase++; - pTargetBase++; - } - pSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - } -} -#else -extern -void __ARM_2D_FUNC(alpha_blending_colour_keying)( - __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint_fast16_t hwRatio, - __API_INT_TYPE Colour); -#endif - -#ifndef __PATCH_COLOUR_FILLING_WITH_ALPHA -__WEAK -void __ARM_2D_FUNC(colour_filling_with_opacity)( - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour, - uint_fast16_t hwRatio) -{ - int_fast16_t iWidth = ptCopySize->iWidth; - int_fast16_t iHeight = ptCopySize->iHeight; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - uint16_t hwRatioCompl = 256 - hwRatio; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++){ - __API_PIXEL_BLENDING( &Colour, pTargetBase++, hwRatioCompl); - } - - pTargetBase += iTargetStride - iWidth; - } -} -#else -extern -void __ARM_2D_FUNC(colour_filling_with_opacity)( - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour, - uint_fast16_t hwRatio); -#endif - -#ifndef __PATCH_COLOUR_FILLING_ALPHA_MASK -__WEAK -void __ARM_2D_FUNC(colour_filling_mask)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint8_t *__RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwAlpha = 256 - (*pchAlpha++); -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwAlpha -= (hwAlpha == 1); -#endif - __API_PIXEL_BLENDING(&Colour, pTarget++, hwAlpha); - } - - pchAlpha += (iAlphaStride - iWidth); - pTarget += (iTargetStride - iWidth); - } -} -#else -extern -void __ARM_2D_FUNC(colour_filling_mask)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint8_t *__RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour); -#endif - - - -#ifndef __PATCH_COLOUR_FILLING_ALPHA_MASK_OPACITY -__WEAK -void __ARM_2D_FUNC(colour_filling_mask_opacity)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint8_t *__RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwAlpha = 256 - ((*pchAlpha++) * hwOpacity >> 8); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwAlpha -= (hwAlpha == 2) * 2; -#endif - - __API_PIXEL_BLENDING(&Colour, pTarget++, hwAlpha); - } - - pchAlpha += (iAlphaStride - iWidth); - pTarget += (iTargetStride - iWidth); - } -} -#else -extern -void __ARM_2D_FUNC(colour_filling_mask_opacity)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint8_t *__RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour, - uint_fast16_t hwOpacity); -#endif - - - -#ifndef __PATCH_COLOUR_FILLING_CHANNEL_MASK -__WEAK -void __ARM_2D_FUNC(colour_filling_channel_mask)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint32_t *__RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwAlpha = 256 - *(uint8_t *)(pwAlpha++); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwAlpha -= (hwAlpha == 1); -#endif - - __API_PIXEL_BLENDING(&Colour, pTarget++, hwAlpha); - } - - pwAlpha += (iAlphaStride - iWidth); - pTarget += (iTargetStride - iWidth); - } -} -#else -extern -void __ARM_2D_FUNC(colour_filling_channel_mask)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint32_t *__RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour); -#endif - - -#ifndef __PATCH_COLOUR_FILLING_CHANNEL_MASK_OPACITY -__WEAK -void __ARM_2D_FUNC(colour_filling_channel_mask_opacity)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint32_t *__RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwAlpha = 256 - (*(uint8_t *)(pwAlpha++) * hwOpacity >> 8); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwAlpha -= (hwAlpha == 2) * 2; -#endif - - __API_PIXEL_BLENDING(&Colour, pTarget++, hwAlpha); - } - - pwAlpha += (iAlphaStride - iWidth); - pTarget += (iTargetStride - iWidth); - } -} -#else -extern -void __ARM_2D_FUNC(colour_filling_channel_mask_opacity)( - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - uint32_t *__RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour, - uint_fast16_t hwOpacity); -#endif - - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_INT_TYPE -#undef __API_PIXEL_BLENDING -#undef __PATCH_ALPHA_BLENDING -#undef __PATCH_ALPHA_BLENDING_COLOUR_MASKING -#undef __PATCH_COLOUR_FILLING_WITH_ALPHA -#undef __PATCH_COLOUR_FILLING_CHANNEL_MASK -#undef __PATCH_COLOUR_FILLING_ALPHA_MASK -#undef __PATCH_COLOUR_FILLING_ALPHA_MASK_OPACITY -#undef __PATCH_COLOUR_FILLING_CHANNEL_MASK_OPACITY - diff --git a/package/Arm2D/Library/Source/__arm_2d_alpha_blending_wrapper.inc b/package/Arm2D/Library/Source/__arm_2d_alpha_blending_wrapper.inc deleted file mode 100644 index 9abedf11c..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_alpha_blending_wrapper.inc +++ /dev/null @@ -1,1506 +0,0 @@ -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_alpha_blending_wrapper.inc - * Description: c code template for copy and fill like operations - * - * $Date: 06. Oct 2021 - * $Revision: V.1.0.0 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_ABW_COLOUR -# error You have to define __API_ABW_COLOUR before using this c template -#endif -#ifndef __API_ABW_INT_TYPE -# error You have to define the __API_ABW_INT_TYPE before using this c template -#endif -#ifndef __API_ABW_INT_TYPE_BIT_NUM -# error You have to define the __API_ABW_INT_TYPE_BIT_NUM before using this c template -#endif -#ifndef __API_ABW_COLOUR_SZ -# error You have to define the __API_ABW_COLOUR_SZ before using this c template -#endif - -#undef ____ABW_FUNC -#undef ___ABW_FUNC -#undef __ABW_FUNC - - - -#ifndef __API_ABW_OP_NAME -# define ____ABW_FUNC(__NAME, __COLOUR) \ - __arm_2d_##__COLOUR##_sw_##__NAME -# define ___ABW_FUNC(__NAME, __COLOUR) ____ABW_FUNC(__NAME, __COLOUR) -#else -# define _____ABW_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __arm_2d_##__COLOUR##_sw_##__OP_NAME##_##__NAME -# define ____ABW_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____ABW_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___ABW_FUNC(__NAME, __COLOUR) \ - ____ABW_FUNC(__API_ABW_OP_NAME, __NAME, __COLOUR) -#endif - -#define __ABW_FUNC(__NAME) ___ABW_FUNC(__NAME, __API_ABW_COLOUR) - - - - -#undef ____ABW_LL_FUNC -#undef ___ABW_LL_FUNC -#undef __ABW_LL_FUNC - - - -#ifndef __API_ABW_LL_OP_NAME -# define ____ABW_LL_FUNC(__NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__NAME -# define ___ABW_LL_FUNC(__NAME, __COLOUR) ____ABW_LL_FUNC(__NAME, __COLOUR) -#else -# define _____ABW_LL_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____ABW_LL_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____ABW_LL_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___ABW_LL_FUNC(__NAME, __COLOUR) \ - ____ABW_LL_FUNC(__API_ABW_LL_OP_NAME, __NAME, __COLOUR) -#endif - -#define __ABW_LL_FUNC(__NAME) ___ABW_LL_FUNC(__NAME, __API_ABW_COLOUR) - - -#undef ____ABW_TYPE -#undef ___ABW_TYPE -#undef __ABW_TYPE - -#ifndef __API_ABW_OP_NAME -# define ____ABW_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___ABW_TYPE(__NAME, __COLOUR) ____ABW_TYPE(__NAME, __COLOUR) -#else -# define _____ABW_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____ABW_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____ABW_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___ABW_TYPE(__NAME, __COLOUR) \ - ____ABW_TYPE(__API_ABW_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __ABW_TYPE(__NAME) ___ABW_TYPE(__NAME, __API_ABW_COLOUR) - - - -arm_fsm_rt_t __ABW_FUNC(tile_copy_with_src_mask)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(NULL != this.Mask.ptSourceSide); - - if (ptTask->Param.tCopyMask.tSrcMask.bInvalid) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - uint32_t wMode = this.wMode; - - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopyMask.tSrcMask.tColour.chScheme) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - __ABW_LL_FUNC(src_chn_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __ABW_LL_FUNC(src_chn_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - &ptTask->Param.tCopy.tCopySize); - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - } else { - assert( ARM_2D_COLOUR_8BIT - == ptTask->Param.tCopyMask.tSrcMask.tColour.chScheme); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - __ABW_LL_FUNC(src_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __ABW_LL_FUNC(src_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - &ptTask->Param.tCopy.tCopySize); - } - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __ABW_FUNC(tile_copy_with_des_mask)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(NULL != this.Mask.ptTargetSide); - - if (ptTask->Param.tCopyMask.tDesMask.bInvalid) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - uint32_t wMode = this.wMode; - - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopyMask.tDesMask.tColour.chScheme) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! \note 1 horizontal line target mask in ARM_2D_CHANNEL_8in32 is not - *! supported when ptTask->Param.tCopy.tCopySize.iHeight is larger - *! than 1 line. - */ - - assert ( ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight - >= ptTask->Param.tCopy.tCopySize.iHeight); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - - __ABW_LL_FUNC(des_chn_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - - } else { - - __ABW_LL_FUNC(des_chn_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else - - - { - assert( ARM_2D_COLOUR_8BIT - == ptTask->Param.tCopyMask.tDesMask.tColour.chScheme); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - if (ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(des_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __ABW_LL_FUNC(1h_des_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - } - - } else { - if (ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(des_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } else { - __ABW_LL_FUNC(1h_des_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } - } - } - - return arm_fsm_rt_cpl; -} - - -arm_fsm_rt_t __ABW_FUNC(tile_copy_with_masks)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(!( (NULL == this.Mask.ptSourceSide) - && (NULL == this.Mask.ptTargetSide))); - - if ( (ptTask->Param.tCopyMask.tSrcMask.bInvalid) - || (ptTask->Param.tCopyMask.tDesMask.bInvalid)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - - uint32_t wMode = this.wMode; - - if ( ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyMask.tSrcMask.tColour.chScheme) - && ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyMask.tDesMask.tColour.chScheme)) { - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! \note both masks use ARM_2D_CHANNEL_8in32 format - *! - *! \note 1 horizontal line target mask in ARM_2D_CHANNEL_8in32 is not - *! supported when ptTask->Param.tCopy.tCopySize.iHeight is larger - *! than 1 line. - */ - - assert ( ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight - >= ptTask->Param.tCopy.tCopySize.iHeight); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __ABW_LL_FUNC(src_chn_msk_des_chn_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - - } else { - - __ABW_LL_FUNC(src_chn_msk_des_chn_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else if ( ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyMask.tSrcMask.tColour.chScheme) - && ( ARM_2D_CHANNEL_8in32 - != ptTask->Param.tCopyMask.tDesMask.tColour.chScheme)) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! only the source mask uses ARM_2D_CHANNEL_8in32 format */ - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - if (ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(src_chn_msk_des_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __ABW_LL_FUNC(src_chn_msk_1h_des_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - } - - } else { - if (ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(src_chn_msk_des_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } else { - __ABW_LL_FUNC(src_chn_msk_1h_des_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else if ( ( ARM_2D_CHANNEL_8in32 - != ptTask->Param.tCopyMask.tSrcMask.tColour.chScheme) - && ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyMask.tDesMask.tColour.chScheme)) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! \note only the target mask uses ARM_2D_CHANNEL_8in32 format - *! - *! \note 1 horizontal line target mask in ARM_2D_CHANNEL_8in32 is not - *! supported when ptTask->Param.tCopy.tCopySize.iHeight is larger - *! than 1 line. - */ - - assert ( ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight - >= ptTask->Param.tCopy.tCopySize.iHeight); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __ABW_LL_FUNC(masks_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - - } else { - - __ABW_LL_FUNC(masks_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else { - assert( ARM_2D_COLOUR_8BIT - == ptTask->Param.tCopyMask.tSrcMask.tColour.chScheme); - assert( ARM_2D_COLOUR_8BIT - == ptTask->Param.tCopyMask.tDesMask.tColour.chScheme); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - if (ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(masks_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __ABW_LL_FUNC(src_msk_1h_des_msk_copy_mirror)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize, - wMode); - } - } else { - if (ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(masks_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } else { - __ABW_LL_FUNC(src_msk_1h_des_msk_copy)( - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tSource.iStride, - - ptTask->Param.tCopyMask.tSrcMask.pBuffer, - ptTask->Param.tCopyMask.tSrcMask.iStride, - &ptTask->Param.tCopyMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.pBuffer, - ptTask->Param.tCopyMask - .use_as____arm_2d_param_copy_t.tTarget.iStride, - - - ptTask->Param.tCopyMask.tDesMask.pBuffer, - ptTask->Param.tCopyMask.tDesMask.iStride, - &ptTask->Param.tCopyMask.tDesMask.tValidRegion.tSize, - &ptTask->Param.tCopy.tCopySize); - } - } - } - - return arm_fsm_rt_cpl; -} - -#if 0 /*! smart leads to larger code size */ -arm_fsm_rt_t __ABW_FUNC(tile_copy_with_mask)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(!( (NULL == this.Mask.ptSourceSide) - && (NULL == this.Mask.ptTargetSide))); - - if ( (!ptTask->Param.tCopyMask.tSrcMask.bInvalid) - && (ptTask->Param.tCopyMask.tDesMask.bInvalid)) { - //! it only contains a mask on the source side - return __ABW_FUNC(tile_copy_with_src_mask)(ptTask); - } else if ( (ptTask->Param.tCopyMask.tSrcMask.bInvalid) - && (!ptTask->Param.tCopyMask.tDesMask.bInvalid)) { - //! it only contains a mask on the target side - return __ABW_FUNC(tile_copy_with_des_mask)(ptTask); - } else if ( (!ptTask->Param.tCopyMask.tSrcMask.bInvalid) - && (!ptTask->Param.tCopyMask.tDesMask.bInvalid)) { - //! it contains masks on both sides - return __ABW_FUNC(tile_copy_with_masks)(ptTask); - } else { - //! it contains no mask - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - //return arm_fsm_rt_cpl; -} -#endif - - -arm_fsm_rt_t __ABW_FUNC(tile_fill_with_src_mask)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(NULL != this.Mask.ptSourceSide); - - if (ptTask->Param.tFillMask.tSrcMask.bInvalid) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - uint32_t wMode = this.wMode; - - - - if ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tFillMask.tSrcMask.tColour.chScheme) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __ABW_LL_FUNC(src_chn_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - wMode); - - - } else { - __ABW_LL_FUNC(src_chn_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize); - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else { - assert( ARM_2D_COLOUR_8BIT - == ptTask->Param.tFillMask.tSrcMask.tColour.chScheme); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __ABW_LL_FUNC(src_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - wMode); - - - } else { - __ABW_LL_FUNC(src_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize); - } - } - - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __ABW_FUNC(tile_fill_with_des_mask)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(NULL != this.Mask.ptTargetSide); - - if (ptTask->Param.tFillMask.tDesMask.bInvalid) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - uint32_t wMode = this.wMode; - - if ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tFillMask.tDesMask.tColour.chScheme) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! \note 1 horizontal line target mask in ARM_2D_CHANNEL_8in32 is not - *! supported when ptTask->Param.tCopy.tCopySize.iHeight is larger - *! than 1 line. - */ - - assert ( ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight - >= ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t - .tTarget.tValidRegion.tSize.iHeight); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __ABW_LL_FUNC(des_chn_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - - - } else { - - __ABW_LL_FUNC(des_chn_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else { - assert( ARM_2D_COLOUR_8BIT - == ptTask->Param.tFillMask.tDesMask.tColour.chScheme); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - if (ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(des_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - } else { - __ABW_LL_FUNC(1h_des_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - } - - } else { - if (ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(des_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - } else { - __ABW_LL_FUNC(1h_des_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - } - } - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __ABW_FUNC(tile_fill_with_masks)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(!( (NULL == this.Mask.ptSourceSide) - && (NULL == this.Mask.ptTargetSide))); - - if ( (ptTask->Param.tFillMask.tSrcMask.bInvalid) - || (ptTask->Param.tFillMask.tDesMask.bInvalid)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - uint32_t wMode = this.wMode; - - - if ( ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tFillMask.tSrcMask.tColour.chScheme) - && ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tFillMask.tDesMask.tColour.chScheme)) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! \note both masks use ARM_2D_CHANNEL_8in32 format - *! - *! \note 1 horizontal line target mask in ARM_2D_CHANNEL_8in32 is not - *! supported when - *! ptTask->Param.tFillMask - *! .use_as____arm_2d_param_fill_t - *! .tTarget.tValidRegion.tSize.iHeight - *! is larger - *! than 1 line. - */ - assert ( ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight - >= ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t - .tTarget.tValidRegion.tSize.iHeight); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __ABW_LL_FUNC(src_chn_msk_des_chn_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - - } else { - - __ABW_LL_FUNC(src_chn_msk_des_chn_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else if ( ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tFillMask.tSrcMask.tColour.chScheme) - && ( ARM_2D_CHANNEL_8in32 - != ptTask->Param.tFillMask.tDesMask.tColour.chScheme)) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! \note only the source mask uses ARM_2D_CHANNEL_8in32 format - */ - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - if (ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(src_chn_msk_des_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - } else { - __ABW_LL_FUNC(src_chn_msk_1h_des_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - } - } else { - if (ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(src_chn_msk_des_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - } else { - __ABW_LL_FUNC(src_chn_msk_1h_des_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - } - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - } else if ( ( ARM_2D_CHANNEL_8in32 - != ptTask->Param.tFillMask.tSrcMask.tColour.chScheme) - && ( ARM_2D_CHANNEL_8in32 - == ptTask->Param.tFillMask.tDesMask.tColour.chScheme)) { - - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - /*! \note only the target mask uses ARM_2D_CHANNEL_8in32 format - *! - *! \note 1 horizontal line target mask in ARM_2D_CHANNEL_8in32 is not - *! supported when - *! ptTask->Param.tFillMask - *! .use_as____arm_2d_param_fill_t - *! .tTarget.tValidRegion.tSize.iHeight - *! is larger - *! than 1 line. - */ - assert ( ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight - >= ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t - .tTarget.tValidRegion.tSize.iHeight); - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __ABW_LL_FUNC(src_msk_des_chn_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - - } else { - - __ABW_LL_FUNC(src_msk_des_chn_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - - } - #else - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #endif - - } else { - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - if (ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(masks_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - } else { - __ABW_LL_FUNC(src_msk_1h_des_msk_fill_mirror)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize, - wMode); - } - } else { - if (ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize.iHeight > 1) { - __ABW_LL_FUNC(masks_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - } else { - __ABW_LL_FUNC(src_msk_1h_des_msk_fill)( - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tSource.tValidRegion.tSize, - - ptTask->Param.tFillMask.tSrcMask.pBuffer, - ptTask->Param.tFillMask.tSrcMask.iStride, - &ptTask->Param.tFillMask.tSrcMask.tValidRegion.tSize, - - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.pBuffer, - ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.iStride, - &ptTask->Param.tFillMask - .use_as____arm_2d_param_fill_t.tTarget.tValidRegion.tSize, - - - ptTask->Param.tFillMask.tDesMask.pBuffer, - ptTask->Param.tFillMask.tDesMask.iStride, - &ptTask->Param.tFillMask.tDesMask.tValidRegion.tSize); - } - } - - } - return arm_fsm_rt_cpl; -} - -#if 0 //! smart detection comes with 50% more code size... -arm_fsm_rt_t __ABW_FUNC(tile_fill_with_mask)( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptTask->ptOP); - assert(__API_ABW_COLOUR_SZ == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - //! this should not happen - assert(!( (NULL == this.Mask.ptSourceSide) - && (NULL == this.Mask.ptTargetSide))); - - - if ( (!ptTask->Param.tFillMask.tSrcMask.bInvalid) - && (ptTask->Param.tFillMask.tDesMask.bInvalid)) { - //! it only contains a mask on the source side - return __ABW_FUNC(tile_fill_with_src_mask)(ptTask); - } else if ( (ptTask->Param.tFillMask.tSrcMask.bInvalid) - && (!ptTask->Param.tFillMask.tDesMask.bInvalid)) { - //! it only contains a mask on the target side - return __ABW_FUNC(tile_fill_with_des_mask)(ptTask); - } else if ( (!ptTask->Param.tFillMask.tSrcMask.bInvalid) - && (!ptTask->Param.tFillMask.tDesMask.bInvalid)) { - //! it contains masks on both sides - return __ABW_FUNC(tile_fill_with_masks)(ptTask); - } else { - //! it contains no mask - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - - //return arm_fsm_rt_cpl; - -} -#endif - - - -#undef __API_ABW_COPY_LIKE_OP_NAME -#undef __API_ABW_COLOUR_SZ -#undef __API_ABW_OP_NAME -#undef ____ABW_FUNC -#undef ___ABW_FUNC -#undef __ABW_FUNC -#undef __API_ABW_LL_OP_NAME -#undef ____ABW_LL_FUNC -#undef ___ABW_LL_FUNC -#undef __ABW_LL_FUNC -#undef __API_ABW_COLOUR -#undef __API_ABW_INT_TYPE -#undef __API_ABW_INT_TYPE_BIT_NUM -#undef ____ABW_TYPE -#undef ___ABW_TYPE -#undef __ABW_TYPE diff --git a/package/Arm2D/Library/Source/__arm_2d_alpha_mask.inc b/package/Arm2D/Library/Source/__arm_2d_alpha_mask.inc deleted file mode 100644 index 55ea23573..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_alpha_mask.inc +++ /dev/null @@ -1,1871 +0,0 @@ -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_alpha_mask.inc - * Description: c code template for copy and fill like operations - * - * $Date: 25. March 2022 - * $Revision: V.1.0.1 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_CAFWM_COLOUR -# error You have to define __API_CAFWM_COLOUR before using this c template -#endif -#ifndef __API_CAFWM_INT_TYPE -# error You have to define the __API_CAFWM_INT_TYPE before using this c template -#endif -#ifndef __API_CAFWM_INT_TYPE_BIT_NUM -# error You have to define the __API_CAFWM_INT_TYPE_BIT_NUM before using this c template -#endif -#ifndef __API_CAFWM_PIXEL_BLENDING -# error You have to define __API_PIXEL_BLENDING before using this c template -#endif - -/*! disable this feature by default */ -#ifndef __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING 0 -#endif - -#ifndef __API_CAFWM_CFG_1_HORIZONTAL_LINE -# define __API_CAFWM_CFG_1_HORIZONTAL_LINE 0 -#endif - -#ifndef __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -# define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 0 -#endif - - -#if __API_CAFWM_CFG_1_HORIZONTAL_LINE && !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -//! rename functions for 'c8bit' 1 horizontal line target mask -# define masks_fill src_msk_1h_des_msk_fill -# define masks_fill_x_mirror src_msk_1h_des_msk_fill_x_mirror -# define masks_fill_y_mirror src_msk_1h_des_msk_fill_y_mirror -# define masks_fill_xy_mirror src_msk_1h_des_msk_fill_xy_mirror -# define masks_fill_mirror src_msk_1h_des_msk_fill_mirror - -# define des_msk_fill 1h_des_msk_fill -# define des_msk_fill_x_mirror 1h_des_msk_fill_x_mirror -# define des_msk_fill_y_mirror 1h_des_msk_fill_y_mirror -# define des_msk_fill_xy_mirror 1h_des_msk_fill_xy_mirror -# define des_msk_fill_mirror 1h_des_msk_fill_mirror - - -# define masks_copy src_msk_1h_des_msk_copy -# define masks_copy_x_mirror src_msk_1h_des_msk_copy_x_mirror -# define masks_copy_y_mirror src_msk_1h_des_msk_copy_y_mirror -# define masks_copy_xy_mirror src_msk_1h_des_msk_copy_xy_mirror -# define masks_copy_mirror src_msk_1h_des_msk_copy_mirror - -# define des_msk_copy 1h_des_msk_copy -# define des_msk_copy_x_mirror 1h_des_msk_copy_x_mirror -# define des_msk_copy_y_mirror 1h_des_msk_copy_y_mirror -# define des_msk_copy_xy_mirror 1h_des_msk_copy_xy_mirror -# define des_msk_copy_mirror 1h_des_msk_copy_mirror - -#elif __API_CAFWM_CFG_1_HORIZONTAL_LINE && __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -//! rename functions for '8in32 channel' 1 horizontal line target mask - -# error Do NOT Support this combination: __API_CAFWM_CFG_1_HORIZONTAL_LINE=1 \ - and __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT=1 ! - -#elif !__API_CAFWM_CFG_1_HORIZONTAL_LINE && __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -//! rename functions for '8in32 channel' - -# define des_msk_fill des_chn_msk_fill -# define des_msk_fill_x_mirror des_chn_msk_fill_x_mirror -# define des_msk_fill_y_mirror des_chn_msk_fill_y_mirror -# define des_msk_fill_xy_mirror des_chn_msk_fill_xy_mirror -# define des_msk_fill_mirror des_chn_msk_fill_mirror - -# define des_msk_copy des_chn_msk_copy -# define des_msk_copy_x_mirror des_chn_msk_copy_x_mirror -# define des_msk_copy_y_mirror des_chn_msk_copy_y_mirror -# define des_msk_copy_xy_mirror des_chn_msk_copy_xy_mirror -# define des_msk_copy_mirror des_chn_msk_copy_mirror - -# define src_msk_fill src_chn_msk_fill -# define src_msk_fill_x_mirror src_chn_msk_fill_x_mirror -# define src_msk_fill_y_mirror src_chn_msk_fill_y_mirror -# define src_msk_fill_xy_mirror src_chn_msk_fill_xy_mirror -# define src_msk_fill_mirror src_chn_msk_fill_mirror - -# define src_msk_copy src_chn_msk_copy -# define src_msk_copy_x_mirror src_chn_msk_copy_x_mirror -# define src_msk_copy_y_mirror src_chn_msk_copy_y_mirror -# define src_msk_copy_xy_mirror src_chn_msk_copy_xy_mirror -# define src_msk_copy_mirror src_chn_msk_copy_mirror - -#endif - - - -#undef ____CAFWM_FUNC -#undef ___CAFWM_FUNC -#undef __CAFWM_FUNC - - - -#ifndef __API_CAFWM_OP_NAME -# define ____CAFWM_FUNC(__NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__NAME -# define ___CAFWM_FUNC(__NAME, __COLOUR) ____CAFWM_FUNC(__NAME, __COLOUR) -#else -# define _____CAFWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____CAFWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____CAFWM_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___CAFWM_FUNC(__NAME, __COLOUR) \ - ____CAFWM_FUNC(__API_CAFWM_OP_NAME, __NAME, __COLOUR) -#endif - -#define __CAFWM_FUNC(__NAME) ___CAFWM_FUNC(__NAME, __API_CAFWM_COLOUR) - - -#undef ____CAFWM_TYPE -#undef ___CAFWM_TYPE -#undef __CAFWM_TYPE - -#ifndef __API_CAFWM_OP_NAME -# define ____CAFWM_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___CAFWM_TYPE(__NAME, __COLOUR) ____CAFWM_TYPE(__NAME, __COLOUR) -#else -# define _____CAFWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____CAFWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____CAFWM_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___CAFWM_TYPE(__NAME, __COLOUR) \ - ____CAFWM_TYPE(__API_CAFWM_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __CAFWM_TYPE(__NAME) ___CAFWM_TYPE(__NAME, __API_CAFWM_COLOUR) - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (both masks) * - *----------------------------------------------------------------------------*/ - - - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - -/*! \note source mask only */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE -# define __API_MCWM_INT_TYPE_BIT_NUM __API_CAFWM_INT_TYPE_BIT_NUM -# define __API_MCWM_PIXEL_BLENDING __API_CAFWM_PIXEL_BLENDING - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 - -# define masks_fill src_chn_msk_des_msk_fill -# define masks_fill_x_mirror src_chn_msk_des_msk_fill_x_mirror -# define masks_fill_y_mirror src_chn_msk_des_msk_fill_y_mirror -# define masks_fill_xy_mirror src_chn_msk_des_msk_fill_xy_mirror -# define masks_fill_mirror src_chn_msk_des_msk_fill_mirror - -# define masks_copy src_chn_msk_des_msk_copy -# define masks_copy_x_mirror src_chn_msk_des_msk_copy_x_mirror -# define masks_copy_y_mirror src_chn_msk_des_msk_copy_y_mirror -# define masks_copy_xy_mirror src_chn_msk_des_msk_copy_xy_mirror -# define masks_copy_mirror src_chn_msk_des_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks.inc" - - - -/*! \note source mask only */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE -# define __API_MCWM_INT_TYPE_BIT_NUM __API_CAFWM_INT_TYPE_BIT_NUM -# define __API_MCWM_PIXEL_BLENDING __API_CAFWM_PIXEL_BLENDING - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 - -# define masks_fill src_chn_msk_1h_des_msk_fill -# define masks_fill_x_mirror src_chn_msk_1h_des_msk_fill_x_mirror -# define masks_fill_y_mirror src_chn_msk_1h_des_msk_fill_y_mirror -# define masks_fill_xy_mirror src_chn_msk_1h_des_msk_fill_xy_mirror -# define masks_fill_mirror src_chn_msk_1h_des_msk_fill_mirror - -# define masks_copy src_chn_msk_1h_des_msk_copy -# define masks_copy_x_mirror src_chn_msk_1h_des_msk_copy_x_mirror -# define masks_copy_y_mirror src_chn_msk_1h_des_msk_copy_y_mirror -# define masks_copy_xy_mirror src_chn_msk_1h_des_msk_copy_xy_mirror -# define masks_copy_mirror src_chn_msk_1h_des_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks.inc" - - -/*! \note des mask only */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE -# define __API_MCWM_INT_TYPE_BIT_NUM __API_CAFWM_INT_TYPE_BIT_NUM -# define __API_MCWM_PIXEL_BLENDING __API_CAFWM_PIXEL_BLENDING - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 1 - -# define masks_fill src_msk_des_chn_msk_fill -# define masks_fill_x_mirror src_msk_des_chn_msk_fill_x_mirror -# define masks_fill_y_mirror src_msk_des_chn_msk_fill_y_mirror -# define masks_fill_xy_mirror src_msk_des_chn_msk_fill_xy_mirror -# define masks_fill_mirror src_msk_des_chn_msk_fill_mirror - -# define masks_copy src_msk_des_chn_msk_copy -# define masks_copy_x_mirror src_msk_des_chn_msk_copy_x_mirror -# define masks_copy_y_mirror src_msk_des_chn_msk_copy_y_mirror -# define masks_copy_xy_mirror src_msk_des_chn_msk_copy_xy_mirror -# define masks_copy_mirror src_msk_des_chn_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks.inc" - - -/*! \note both masks */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE -# define __API_MCWM_INT_TYPE_BIT_NUM __API_CAFWM_INT_TYPE_BIT_NUM -# define __API_MCWM_PIXEL_BLENDING __API_CAFWM_PIXEL_BLENDING - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 1 - -# define masks_fill src_chn_msk_des_chn_msk_fill -# define masks_fill_x_mirror src_chn_msk_des_chn_msk_fill_x_mirror -# define masks_fill_y_mirror src_chn_msk_des_chn_msk_fill_y_mirror -# define masks_fill_xy_mirror src_chn_msk_des_chn_msk_fill_xy_mirror -# define masks_fill_mirror src_chn_msk_des_chn_msk_fill_mirror - -# define masks_copy src_chn_msk_des_chn_msk_copy -# define masks_copy_x_mirror src_chn_msk_des_chn_msk_copy_x_mirror -# define masks_copy_y_mirror src_chn_msk_des_chn_msk_copy_y_mirror -# define masks_copy_xy_mirror src_chn_msk_des_chn_msk_copy_xy_mirror -# define masks_copy_mirror src_chn_msk_des_chn_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks.inc" - -#else - -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE -# define __API_MCWM_INT_TYPE_BIT_NUM __API_CAFWM_INT_TYPE_BIT_NUM -# define __API_MCWM_PIXEL_BLENDING __API_CAFWM_PIXEL_BLENDING - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE \ - __API_CAFWM_CFG_1_HORIZONTAL_LINE -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 0 - -# include "__arm_2d_meta_copy_with_masks.inc" - -#endif - - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (target mask only) * - *----------------------------------------------------------------------------*/ - -__WEAK -void __CAFWM_FUNC(des_msk_fill)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc++, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - -__WEAK -void __CAFWM_FUNC(des_msk_fill_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - - ptSrc += ptSourceSize->iWidth - 1; - - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc--, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - - -} - -__WEAK -void __CAFWM_FUNC(des_msk_fill_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc++, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - -} - -__WEAK -void __CAFWM_FUNC(des_msk_fill_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - ptSrc += ptSourceSize->iWidth - 1; - - - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc--, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - -} - - -__WEAK -void __CAFWM_FUNC(des_msk_fill_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __CAFWM_FUNC(des_msk_fill_x_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptTargetBase, iTargetStride, ptTargetSize, - ptTargetMaskBase, iTargetMaskStride, ptTargetMaskSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __CAFWM_FUNC(des_msk_fill_y_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptTargetBase, iTargetStride, ptTargetSize, - ptTargetMaskBase, iTargetMaskStride, ptTargetMaskSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR : - __CAFWM_FUNC(des_msk_fill_xy_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptTargetBase, iTargetStride, ptTargetSize, - ptTargetMaskBase, iTargetMaskStride, ptTargetMaskSize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - - - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (src mask only) * - *----------------------------------------------------------------------------*/ -#if !__API_CAFWM_CFG_1_HORIZONTAL_LINE -__WEAK -void __CAFWM_FUNC(src_msk_fill)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptSrcMsk++); - #else - uint16_t hwOpacity = 256 - (*ptSrcMsk++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc++, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - -__WEAK -void __CAFWM_FUNC(src_msk_fill_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - ptSrc += ptSourceSize->iWidth - 1; - ptSrcMsk += ptSourceSize->iWidth - 1; - - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptSrcMsk--); - #else - uint16_t hwOpacity = 256 - (*ptSrcMsk--); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc--, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - - -} - -__WEAK -void __CAFWM_FUNC(src_msk_fill_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptSrcMsk++); - #else - uint16_t hwOpacity = 256 - (*ptSrcMsk++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc++, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - -} - -__WEAK -void __CAFWM_FUNC(src_msk_fill_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - ptSrc += ptSourceSize->iWidth - 1; - ptSrcMsk += ptSourceSize->iWidth - 1; - - - for (int_fast16_t x = 0; x < wLength; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptSrcMsk--); - #else - uint16_t hwOpacity = 256 - (*ptSrcMsk--); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING(ptSrc--, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - -} - - -__WEAK -void __CAFWM_FUNC(src_msk_fill_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __CAFWM_FUNC(src_msk_fill_x_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptSourceMaskBase, iSourceMaskStride, ptSourceMaskSize, - ptTargetBase, iTargetStride, ptTargetSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __CAFWM_FUNC(src_msk_fill_y_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptSourceMaskBase, iSourceMaskStride, ptSourceMaskSize, - ptTargetBase, iTargetStride, ptTargetSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR : - __CAFWM_FUNC(src_msk_fill_xy_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptSourceMaskBase, iSourceMaskStride, ptSourceMaskSize, - ptTargetBase, iTargetStride, ptTargetSize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} -#endif - - -/*----------------------------------------------------------------------------* - * Copy with Mirroring (target mask only) * - *----------------------------------------------------------------------------*/ - -__WEAK -void __CAFWM_FUNC(des_msk_copy)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - //uint16_t hwRatioCompl = 256 - chRatio; -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( pSourceBase++, pTargetBase++, hwOpacity); - - } - pSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - } -} - - -__WEAK -void __CAFWM_FUNC(des_msk_copy_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - //__API_CAFWM_INT_TYPE *ptTargetCur = pTargetBase; - __API_CAFWM_INT_TYPE *ptSourceCur = pSourceBase; - - ptSourceCur += ptCopySize->iWidth - 1; - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( ptSourceCur--, pTargetBase++, hwOpacity); - - } - pSourceBase += iSourceStride; - pTargetBase += (iTargetStride - iWidth); - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - } -} - - -__WEAK -void __CAFWM_FUNC(des_msk_copy_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - - for ( int_fast16_t y = 0; y < iHeight; y++) { - - __API_CAFWM_INT_TYPE *ptSourceCur = pSourceBase; - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( ptSourceCur++, pTargetBase++, hwOpacity); - - } - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride - iWidth); - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - } - -} - - -__WEAK -void __CAFWM_FUNC(des_msk_copy_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - - for ( int_fast16_t y = 0; y < iHeight; y++) { - - __API_CAFWM_INT_TYPE *ptSourceCur = pSourceBase; - - ptSourceCur += ptCopySize->iWidth - 1; - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptTargetMask++); - #else - uint16_t hwOpacity = 256 - (*ptTargetMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( ptSourceCur--, pTargetBase++, hwOpacity); - - } - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride - iWidth); - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - } - -} - -__WEAK -void __CAFWM_FUNC(des_msk_copy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __CAFWM_FUNC(des_msk_copy_x_mirror)(pSourceBase, iSourceStride, - pTargetBase, iTargetStride, - ptTargetMaskBase, iTargetMaskStride, - ptTargetMaskSize, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __CAFWM_FUNC(des_msk_copy_y_mirror)(pSourceBase, iSourceStride, - pTargetBase, iTargetStride, - ptTargetMaskBase, iTargetMaskStride, - ptTargetMaskSize, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR: - __CAFWM_FUNC(des_msk_copy_xy_mirror)(pSourceBase, iSourceStride, - pTargetBase, iTargetStride, - ptTargetMaskBase, iTargetMaskStride, - ptTargetMaskSize, - ptCopySize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - - - -/*----------------------------------------------------------------------------* - * Copy with Mirroring (src mask only) * - *----------------------------------------------------------------------------*/ -#if !__API_CAFWM_CFG_1_HORIZONTAL_LINE -__WEAK -void __CAFWM_FUNC(src_msk_copy)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for (int_fast16_t y = 0; y < iHeight; y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(ptSourceMask++); - #else - uint16_t hwOpacity = 256 - (*ptSourceMask++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( pSourceBase++, pTargetBase++, hwOpacity); - - } - pSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += (iSourceMaskStride - iWidth); - } - #else - ptSourceMask += (iSourceMaskStride - iWidth); - #endif - } -} - - -__WEAK -void __CAFWM_FUNC(src_msk_copy_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for (int_fast16_t y = 0; y < iHeight; y++) { - - __API_CAFWM_INT_TYPE *ptTargetCur = pTargetBase; - __API_CAFWM_INT_TYPE *ptSourceCur = pSourceBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *pchSourceMaskCur = ptSourceMask; - #else - uint8_t *pchSourceMaskCur = ptSourceMask; - #endif - - ptSourceCur += ptCopySize->iWidth - 1; - //! \note do not use ptSourceMaskSize->iWidth - pchSourceMaskCur += ptCopySize->iWidth - 1; - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(pchSourceMaskCur--); - #else - uint16_t hwOpacity = 256 - (*pchSourceMaskCur--); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( ptSourceCur--, ptTargetCur++, hwOpacity); - - } - pSourceBase += iSourceStride; - pTargetBase += iTargetStride; - - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - } -} - - -__WEAK -void __CAFWM_FUNC(src_msk_copy_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for (int_fast16_t y = 0; y < iHeight; y++) { - - __API_CAFWM_INT_TYPE *ptSourceCur = pSourceBase; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *pchSourceMaskCur = ptSourceMask; - #else - uint8_t *pchSourceMaskCur = ptSourceMask; - #endif - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(pchSourceMaskCur++); - #else - uint16_t hwOpacity = 256 - (*pchSourceMaskCur++); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( ptSourceCur++, pTargetBase++, hwOpacity); - } - - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride - iWidth); - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - } - -} - - -__WEAK -void __CAFWM_FUNC(src_msk_copy_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for (int_fast16_t y = 0; y < iHeight; y++) { - - __API_CAFWM_INT_TYPE *ptSourceCur = pSourceBase; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *pchSourceMaskCur = ptSourceMask; - #else - uint8_t *pchSourceMaskCur = ptSourceMask; - #endif - - ptSourceCur += ptCopySize->iWidth - 1; - //! \note do not use ptSourceMaskSize->iWidth - pchSourceMaskCur += ptCopySize->iWidth - 1; - - for (int_fast16_t x = 0; x < iWidth; x++) { - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint16_t hwOpacity = 256 - *(uint8_t *)(pchSourceMaskCur--); - #else - uint16_t hwOpacity = 256 - (*pchSourceMaskCur--); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 1); - #endif - - __API_CAFWM_PIXEL_BLENDING( ptSourceCur--, pTargetBase++, hwOpacity); - - } - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride - iWidth); - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - } - -} - -__WEAK -void __CAFWM_FUNC(src_msk_copy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __CAFWM_FUNC(src_msk_copy_x_mirror)(pSourceBase, iSourceStride, - ptSourceMaskBase, iSourceMaskStride, - ptSourceMaskSize, - pTargetBase, iTargetStride, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __CAFWM_FUNC(src_msk_copy_y_mirror)(pSourceBase, iSourceStride, - ptSourceMaskBase, iSourceMaskStride, - ptSourceMaskSize, - pTargetBase, iTargetStride, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR: - __CAFWM_FUNC(src_msk_copy_xy_mirror)(pSourceBase, iSourceStride, - ptSourceMaskBase, iSourceMaskStride, - ptSourceMaskSize, - pTargetBase, iTargetStride, - ptCopySize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} -#endif - - -#undef masks_fill -#undef masks_fill_x_mirror -#undef masks_fill_y_mirror -#undef masks_fill_xy_mirror -#undef masks_fill_mirror - -#undef des_msk_fill -#undef des_msk_fill_x_mirror -#undef des_msk_fill_y_mirror -#undef des_msk_fill_xy_mirror -#undef des_msk_fill_mirror - - -#undef masks_copy -#undef masks_copy_x_mirror -#undef masks_copy_y_mirror -#undef masks_copy_xy_mirror -#undef masks_copy_mirror - -#undef des_msk_copy -#undef des_msk_copy_x_mirror -#undef des_msk_copy_y_mirror -#undef des_msk_copy_xy_mirror -#undef des_msk_copy_mirror - -#undef src_msk_fill -#undef src_msk_fill_x_mirror -#undef src_msk_fill_y_mirror -#undef src_msk_fill_xy_mirror -#undef src_msk_fill_mirror - -#undef src_msk_copy -#undef src_msk_copy_x_mirror -#undef src_msk_copy_y_mirror -#undef src_msk_copy_xy_mirror -#undef src_msk_copy_mirror - - -#undef __API_CAFWM_COPY_LIKE_OP_NAME -#undef __API_CAFWM_OP_NAME -#undef __API_CAFWM_PIXEL_BLENDING -#undef ____CAFWM_FUNC -#undef ___CAFWM_FUNC -#undef __CAFWM_FUNC -#undef __API_CAFWM_COLOUR -#undef __API_CAFWM_INT_TYPE -#undef __API_CAFWM_INT_TYPE_BIT_NUM -#undef ____CAFWM_TYPE -#undef ___CAFWM_TYPE -#undef __CAFWM_TYPE -#undef __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -#undef __API_CAFWM_CFG_1_HORIZONTAL_LINE -#undef __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - diff --git a/package/Arm2D/Library/Source/__arm_2d_alpha_mask_helium.inc b/package/Arm2D/Library/Source/__arm_2d_alpha_mask_helium.inc deleted file mode 100644 index cd3c3b4bf..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_alpha_mask_helium.inc +++ /dev/null @@ -1,2441 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_alpha_mask_helium.inc - * Description: c code template for copy and fill like operations - * - * $Date: 12. July 2022 - * $Revision: v1.0.1 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_CAFWM_COLOUR -# error You have to define __API_CAFWM_COLOUR before using this c template -#endif - -#define PIXTYP_IS_gray8 1 -#define PIXTYP_IS_rgb565 2 -#define PIXTYP_IS_cccn888 3 - -#define CHECKPIXTYP(NAME1, NAME2) CHECKPIXTYP_impl(NAME1, NAME2) -#define CHECKPIXTYP_impl(NAME1, NAME2) PIXTYP_IS_ ## NAME1 == PIXTYP_IS_ ## NAME2 - -#define CHECKPIXTYP_NOT(NAME1, NAME2) CHECKPIXTYP_NOT_impl(NAME1, NAME2) -#define CHECKPIXTYP_NOT_impl(NAME1, NAME2) PIXTYP_IS_ ## NAME1 != PIXTYP_IS_ ## NAME2 - - -#if CHECKPIXTYP(__API_CAFWM_COLOUR, rgb565) -#define __API_CAFWM_INT_TYPE uint16_t -#define __API_CAFWM_PIXEL_BIT_NUM 16 -#define __API_CAFWM_PIXEL_VECLOAD vld1q -#define __API_CAFWM_PIXEL_GATHVECLOAD vldrhq_gather_shifted_offset -#define __API_CAFWM_PIXEL_PVECSTORE vst1q_p -#define __API_CAFWM_PIXEL_BLENDING __arm_2d_rgb565_blending_opacity_single_vec - -#elif CHECKPIXTYP(__API_CAFWM_COLOUR, gray8) -#define __API_CAFWM_INT_TYPE uint8_t -#define __API_CAFWM_PIXEL_BIT_NUM 16 /* widening involved */ -#define __API_CAFWM_PIXEL_VECLOAD vldrbq_u16 -#define __API_CAFWM_PIXEL_GATHVECLOAD vldrbq_gather_offset_u16 -#define __API_CAFWM_PIXEL_PVECSTORE vstrbq_p_u16 -#define __API_CAFWM_PIXEL_BLENDING __arm_2d_gray8_blending_opacity_single_vec - -#elif CHECKPIXTYP(__API_CAFWM_COLOUR, cccn888) -#define __API_CAFWM_INT_TYPE uint32_t -#if !ENABLE_ALT_MASK_FILL -#define __API_CAFWM_PIXEL_BIT_NUM 32 -#define __API_CAFWM_PIXEL_VECLOAD vld1q -#define __API_CAFWM_PIXEL_GATHVECLOAD vldrwq_gather_shifted_offset -#define __API_CAFWM_PIXEL_PVECSTORE vst1q_p -#define __API_CAFWM_PIXEL_BLENDING __arm_2d_cccn888_blending_opacity_single_vec -#else -#define __API_CAFWM_PIXEL_BIT_NUM 16 /* widening involved */ -#define __API_CAFWM_PIXEL_VECLOAD vldrbq_u16 -#define __API_CAFWM_PIXEL_GATHVECLOAD vldrbq_gather_offset_u16 -#define __API_CAFWM_PIXEL_PVECSTORE vstrbq_p_u16 -#define __API_CAFWM_PIXEL_BLENDING __arm_2d_gray8_blending_opacity_single_vec -#endif - -#else -#error Unknown colour -#endif - -#define __API_CAFWM_PIXEL_VECTYP ARM_PIX_VECTYP(__API_CAFWM_PIXEL_BIT_NUM) -#define __API_CAFWM_VEC_INCR ARM_PIX_VECELT(__API_CAFWM_PIXEL_BIT_NUM) - -/*! disable this feature by default */ -#ifndef __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING 0 -#endif - -#ifndef __API_CAFWM_CFG_1_HORIZONTAL_LINE -# define __API_CAFWM_CFG_1_HORIZONTAL_LINE 0 -#endif - -#ifndef __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -# define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 0 -#endif - - -#if __API_CAFWM_CFG_1_HORIZONTAL_LINE && !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -//! rename functions for 'c8bit' 1 horizontal line target mask -# define masks_fill src_msk_1h_des_msk_fill -# define masks_fill_x_mirror src_msk_1h_des_msk_fill_x_mirror -# define masks_fill_y_mirror src_msk_1h_des_msk_fill_y_mirror -# define masks_fill_xy_mirror src_msk_1h_des_msk_fill_xy_mirror -# define masks_fill_mirror src_msk_1h_des_msk_fill_mirror - -# define des_msk_fill 1h_des_msk_fill -# define des_msk_fill_x_mirror 1h_des_msk_fill_x_mirror -# define des_msk_fill_y_mirror 1h_des_msk_fill_y_mirror -# define des_msk_fill_xy_mirror 1h_des_msk_fill_xy_mirror -# define des_msk_fill_mirror 1h_des_msk_fill_mirror - - -# define masks_copy src_msk_1h_des_msk_copy -# define masks_copy_x_mirror src_msk_1h_des_msk_copy_x_mirror -# define masks_copy_y_mirror src_msk_1h_des_msk_copy_y_mirror -# define masks_copy_xy_mirror src_msk_1h_des_msk_copy_xy_mirror -# define masks_copy_mirror src_msk_1h_des_msk_copy_mirror - -# define des_msk_copy 1h_des_msk_copy -# define des_msk_copy_x_mirror 1h_des_msk_copy_x_mirror -# define des_msk_copy_y_mirror 1h_des_msk_copy_y_mirror -# define des_msk_copy_xy_mirror 1h_des_msk_copy_xy_mirror -# define des_msk_copy_mirror 1h_des_msk_copy_mirror - -#elif __API_CAFWM_CFG_1_HORIZONTAL_LINE && __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -//! rename functions for '8in32 channel' 1 horizontal line target mask - -# error Do NOT Support this combination: __API_CAFWM_CFG_1_HORIZONTAL_LINE=1 \ - and __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT=1 ! - -#elif !__API_CAFWM_CFG_1_HORIZONTAL_LINE && __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT -//! rename functions for '8in32 channel' - -# define des_msk_fill des_chn_msk_fill -# define des_msk_fill_x_mirror des_chn_msk_fill_x_mirror -# define des_msk_fill_y_mirror des_chn_msk_fill_y_mirror -# define des_msk_fill_xy_mirror des_chn_msk_fill_xy_mirror -# define des_msk_fill_mirror des_chn_msk_fill_mirror - -# define des_msk_copy des_chn_msk_copy -# define des_msk_copy_x_mirror des_chn_msk_copy_x_mirror -# define des_msk_copy_y_mirror des_chn_msk_copy_y_mirror -# define des_msk_copy_xy_mirror des_chn_msk_copy_xy_mirror -# define des_msk_copy_mirror des_chn_msk_copy_mirror - -# define src_msk_fill src_chn_msk_fill -# define src_msk_fill_x_mirror src_chn_msk_fill_x_mirror -# define src_msk_fill_y_mirror src_chn_msk_fill_y_mirror -# define src_msk_fill_xy_mirror src_chn_msk_fill_xy_mirror -# define src_msk_fill_mirror src_chn_msk_fill_mirror - -# define src_msk_copy src_chn_msk_copy -# define src_msk_copy_x_mirror src_chn_msk_copy_x_mirror -# define src_msk_copy_y_mirror src_chn_msk_copy_y_mirror -# define src_msk_copy_xy_mirror src_chn_msk_copy_xy_mirror -# define src_msk_copy_mirror src_chn_msk_copy_mirror - -#endif - - - -#undef ____CAFWM_FUNC -#undef ___CAFWM_FUNC -#undef __CAFWM_FUNC - - - -#ifndef __API_CAFWM_OP_NAME -# define ____CAFWM_FUNC(__NAME, __COLOUR) \ - __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__NAME) -# define ___CAFWM_FUNC(__NAME, __COLOUR) ____CAFWM_FUNC(__NAME, __COLOUR) -#else -# define _____CAFWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME) -# define ____CAFWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____CAFWM_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___CAFWM_FUNC(__NAME, __COLOUR) \ - ____CAFWM_FUNC(__API_CAFWM_OP_NAME, __NAME, __COLOUR) -#endif - -#define __CAFWM_FUNC(__NAME) ___CAFWM_FUNC(__NAME, __API_CAFWM_COLOUR) - - -#undef ____CAFWM_TYPE -#undef ___CAFWM_TYPE -#undef __CAFWM_TYPE - -#ifndef __API_CAFWM_OP_NAME -# define ____CAFWM_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___CAFWM_TYPE(__NAME, __COLOUR) ____CAFWM_TYPE(__NAME, __COLOUR) -#else -# define _____CAFWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____CAFWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____CAFWM_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___CAFWM_TYPE(__NAME, __COLOUR) \ - ____CAFWM_TYPE(__API_CAFWM_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __CAFWM_TYPE(__NAME) ___CAFWM_TYPE(__NAME, __API_CAFWM_COLOUR) - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (both masks) * - *----------------------------------------------------------------------------*/ - - - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - -/*! \note source mask only */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 - -# define masks_fill src_chn_msk_des_msk_fill -# define masks_fill_x_mirror src_chn_msk_des_msk_fill_x_mirror -# define masks_fill_y_mirror src_chn_msk_des_msk_fill_y_mirror -# define masks_fill_xy_mirror src_chn_msk_des_msk_fill_xy_mirror -# define masks_fill_mirror src_chn_msk_des_msk_fill_mirror - -# define masks_copy src_chn_msk_des_msk_copy -# define masks_copy_x_mirror src_chn_msk_des_msk_copy_x_mirror -# define masks_copy_y_mirror src_chn_msk_des_msk_copy_y_mirror -# define masks_copy_xy_mirror src_chn_msk_des_msk_copy_xy_mirror -# define masks_copy_mirror src_chn_msk_des_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks_helium.inc" - - - -/*! \note source mask only */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 - -# define masks_fill src_chn_msk_1h_des_msk_fill -# define masks_fill_x_mirror src_chn_msk_1h_des_msk_fill_x_mirror -# define masks_fill_y_mirror src_chn_msk_1h_des_msk_fill_y_mirror -# define masks_fill_xy_mirror src_chn_msk_1h_des_msk_fill_xy_mirror -# define masks_fill_mirror src_chn_msk_1h_des_msk_fill_mirror - -# define masks_copy src_chn_msk_1h_des_msk_copy -# define masks_copy_x_mirror src_chn_msk_1h_des_msk_copy_x_mirror -# define masks_copy_y_mirror src_chn_msk_1h_des_msk_copy_y_mirror -# define masks_copy_xy_mirror src_chn_msk_1h_des_msk_copy_xy_mirror -# define masks_copy_mirror src_chn_msk_1h_des_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks_helium.inc" - - -/*! \note des mask only */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 1 - -# define masks_fill src_msk_des_chn_msk_fill -# define masks_fill_x_mirror src_msk_des_chn_msk_fill_x_mirror -# define masks_fill_y_mirror src_msk_des_chn_msk_fill_y_mirror -# define masks_fill_xy_mirror src_msk_des_chn_msk_fill_xy_mirror -# define masks_fill_mirror src_msk_des_chn_msk_fill_mirror - -# define masks_copy src_msk_des_chn_msk_copy -# define masks_copy_x_mirror src_msk_des_chn_msk_copy_x_mirror -# define masks_copy_y_mirror src_msk_des_chn_msk_copy_y_mirror -# define masks_copy_xy_mirror src_msk_des_chn_msk_copy_xy_mirror -# define masks_copy_mirror src_msk_des_chn_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks_helium.inc" - - -/*! \note both masks */ -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 1 - -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 1 - -# define masks_fill src_chn_msk_des_chn_msk_fill -# define masks_fill_x_mirror src_chn_msk_des_chn_msk_fill_x_mirror -# define masks_fill_y_mirror src_chn_msk_des_chn_msk_fill_y_mirror -# define masks_fill_xy_mirror src_chn_msk_des_chn_msk_fill_xy_mirror -# define masks_fill_mirror src_chn_msk_des_chn_msk_fill_mirror - -# define masks_copy src_chn_msk_des_chn_msk_copy -# define masks_copy_x_mirror src_chn_msk_des_chn_msk_copy_x_mirror -# define masks_copy_y_mirror src_chn_msk_des_chn_msk_copy_y_mirror -# define masks_copy_xy_mirror src_chn_msk_des_chn_msk_copy_xy_mirror -# define masks_copy_mirror src_chn_msk_des_chn_msk_copy_mirror - - -# include "__arm_2d_meta_copy_with_masks_helium.inc" - -#else - -# define __API_MCWM_COLOUR __API_CAFWM_COLOUR -# define __API_MCWM_INT_TYPE __API_CAFWM_INT_TYPE - -# if defined(__API_CAFWM_OP_NAME) -# define __API_MCWM_OP_NAME __API_CAFWM_OP_NAME -# endif - -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING \ - __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_1_HORIZONTAL_LINE \ - __API_CAFWM_CFG_1_HORIZONTAL_LINE -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 0 - -# include "__arm_2d_meta_copy_with_masks_helium.inc" - -#endif - - - - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (target mask only) * - *----------------------------------------------------------------------------*/ - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_fill)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = wLength; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, - __API_CAFWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - ptTarget += wLength; - ptTargetMask += wLength; - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_fill_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - uint16_t srcWidth = ptSourceSize->iWidth; -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = srcWidth - 1; - int32_t blkCnt = wLength; - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - - ptTarget += wLength; - ptTargetMask += wLength; - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_fill_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = wLength; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - ptTarget += wLength; - ptTargetMask += wLength; - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_fill_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - __API_CAFWM_INT_TYPE srcWidth = ptSourceSize->iWidth; -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = srcWidth - 1; - int32_t blkCnt = wLength; - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - - ptTarget += wLength; - ptTargetMask += wLength; - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (src mask only) * - *----------------------------------------------------------------------------*/ -#if !__API_CAFWM_CFG_1_HORIZONTAL_LINE -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_fill)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - int32_t blkCnt = wLength; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, - __API_CAFWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptSrcMsk += __API_CAFWM_VEC_INCR; - #endif - - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - ptTarget += wLength; - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_fill_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - uint16_t srcWidth = ptSourceSize->iWidth; - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - uint32_t curDecrStride1Idx = srcWidth - 1; - int32_t blkCnt = wLength; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curDecrStride4Idx = 4*(srcWidth - 1); - __API_CAFWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM) - ((uint8_t *)ptSrcMsk, vDecrStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM) - (ptSrcMsk, vDecrStride1Offs); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - - ptTarget += wLength; - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_fill_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - int32_t blkCnt = wLength; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptSrcMsk += __API_CAFWM_VEC_INCR; - #endif - - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - ptTarget += wLength; - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_fill_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize) -{ - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - __API_CAFWM_INT_TYPE srcWidth = ptSourceSize->iWidth; - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_CAFWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - uint32_t curDecrStride1Idx = srcWidth - 1; - int32_t blkCnt = wLength; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curDecrStride4Idx = 4*(srcWidth - 1); - __API_CAFWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)((uint8_t *)ptSrcMsk, vDecrStride4Offs); - - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)(ptSrcMsk, vDecrStride1Offs); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - - ptTarget += wLength; - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - -#endif - - - - - - -/*----------------------------------------------------------------------------* - * Copy with Mirroring (target mask only) * - *----------------------------------------------------------------------------*/ - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_copy)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = iWidth; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase += (iSourceStride); - pTargetBase += (iTargetStride); - - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - } -} - - - - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_copy_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = iWidth - 1; - int32_t blkCnt = iWidth; - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - - pSourceBase += iSourceStride; - pTargetBase += iTargetStride; - - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - - } -} - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_copy_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = iWidth; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride); - - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - } - -} - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(des_msk_copy_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptTargetMaskBase, - #else - uint8_t * __RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = iWidth - 1; - int32_t blkCnt = iWidth; - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecTargetMask); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_CAFWM_VEC_INCR; - #endif - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride); - - - #if __API_CAFWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - } - -} - - - -/*----------------------------------------------------------------------------* - * Copy with Mirroring (src mask only) * - *----------------------------------------------------------------------------*/ -#if !__API_CAFWM_CFG_1_HORIZONTAL_LINE -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_copy)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - int32_t blkCnt = iWidth; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptSrcMsk += __API_CAFWM_VEC_INCR; - #endif - - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase += (iSourceStride); - pTargetBase += (iTargetStride); - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += (iSourceMaskStride); - } - #else - ptSourceMask += (iSourceMaskStride); - #endif - - } -} - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_copy_x_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - uint32_t curDecrStride1Idx = iWidth - 1; - int32_t blkCnt = iWidth; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curDecrStride4Idx = 4*(iWidth - 1); - __API_CAFWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)((uint8_t *)ptSrcMsk, vDecrStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)(ptSrcMsk, vDecrStride1Offs); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - - pSourceBase += iSourceStride; - pTargetBase += iTargetStride; - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - } -} - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_copy_y_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curIncStride4Idx = 0; - __API_CAFWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - int32_t blkCnt = iWidth; - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = __API_CAFWM_PIXEL_VECLOAD(ptSrc); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_u, __API_CAFWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = __API_CAFWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - ptSrcMsk += __API_CAFWM_VEC_INCR; - #endif - - - ptTargetCur += __API_CAFWM_VEC_INCR; - ptSrc += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride); - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - } -} - - -__OVERRIDE_WEAK -void __CAFWM_FUNC(src_msk_copy_xy_mirror)( - __API_CAFWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_CAFWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_CAFWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(256); - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - - -#if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - - -#if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_CAFWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_CAFWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - uint32_t curDecrStride1Idx = iWidth - 1; - int32_t blkCnt = iWidth; - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - uint32_t curDecrStride4Idx = 4*(iWidth - 1); - __API_CAFWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_CAFWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_CAFWM_PIXEL_VECTYP vecTarget = __API_CAFWM_PIXEL_VECLOAD(ptTargetCur); - __API_CAFWM_PIXEL_VECTYP vecSource = - __API_CAFWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)((uint8_t *)ptSrcMsk, vDecrStride4Offs); - #else - __API_CAFWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_CAFWM_PIXEL_BIT_NUM)(ptSrcMsk, vDecrStride1Offs); - #endif - __API_CAFWM_PIXEL_VECTYP vecHwOpacity = vsubq(v256, vecSrcMsk); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_CAFWM_PIXEL_BIT_NUM)(vecHwOpacity, 1)); - #endif - - vecTarget = - __API_CAFWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_CAFWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_CAFWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_CAFWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - ptTargetCur += __API_CAFWM_VEC_INCR; - - blkCnt -= __API_CAFWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride); - - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - } -} - - - - -#endif - -#undef masks_fill -#undef masks_fill_x_mirror -#undef masks_fill_y_mirror -#undef masks_fill_xy_mirror -#undef masks_fill_mirror - -#undef des_msk_fill -#undef des_msk_fill_x_mirror -#undef des_msk_fill_y_mirror -#undef des_msk_fill_xy_mirror -#undef des_msk_fill_mirror - - -#undef masks_copy -#undef masks_copy_x_mirror -#undef masks_copy_y_mirror -#undef masks_copy_xy_mirror -#undef masks_copy_mirror - -#undef des_msk_copy -#undef des_msk_copy_x_mirror -#undef des_msk_copy_y_mirror -#undef des_msk_copy_xy_mirror -#undef des_msk_copy_mirror - -#undef src_msk_fill -#undef src_msk_fill_x_mirror -#undef src_msk_fill_y_mirror -#undef src_msk_fill_xy_mirror -#undef src_msk_fill_mirror - -#undef src_msk_copy -#undef src_msk_copy_x_mirror -#undef src_msk_copy_y_mirror -#undef src_msk_copy_xy_mirror -#undef src_msk_copy_mirror - - -#undef __API_CAFWM_COPY_LIKE_OP_NAME -#undef __API_CAFWM_OP_NAME -#undef __API_CAFWM_PIXEL_BLENDING -#undef ____CAFWM_FUNC -#undef ___CAFWM_FUNC -#undef __CAFWM_FUNC -#undef __API_CAFWM_COLOUR -#undef __API_CAFWM_INT_TYPE -#undef __API_CAFWM_PIXEL_BIT_NUM -#undef __API_CAFWM_PIXEL_VECLOAD -#undef __API_CAFWM_PIXEL_GATHVECLOAD -#undef __API_CAFWM_PIXEL_PVECSTORE -#undef ____CAFWM_TYPE -#undef ___CAFWM_TYPE -#undef __CAFWM_TYPE -#undef __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING -#undef __API_CAFWM_CFG_1_HORIZONTAL_LINE -#undef __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT - diff --git a/package/Arm2D/Library/Source/__arm_2d_conversion_helium.c b/package/Arm2D/Library/Source/__arm_2d_conversion_helium.c deleted file mode 100644 index 94a6281b6..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_conversion_helium.c +++ /dev/null @@ -1,702 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm-2d_conversion_helium.c - * Description: APIs for colour format conversion with Helium acceleration - * - * $Date: 08. Aug 2022 - * $Revision: V.0.2.0 - * - * Target Processor: Cortex-M cores with Helium - * - * -------------------------------------------------------------------- */ - -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#ifdef __ARM_2D_COMPILATION_UNIT -#undef __ARM_2D_COMPILATION_UNIT - -#if defined(__ARM_2D_HAS_HELIUM__) && __ARM_2D_HAS_HELIUM__ - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wvector-conversion" -# pragma clang diagnostic ignored "-Wundef" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#endif - - -/*============================ INCLUDES ======================================*/ - -#include "__arm_2d_utils_helium.h" -#ifdef __cplusplus -extern "C" { -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_to_rgb565)(uint32_t *__RESTRICT pwSourceBase, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - int32_t blkCnt; - uint32x4_t maskR = vdupq_n_u32(0x001f); - uint32x4_t maskG = vdupq_n_u32(0x07e0); - uint32x4_t maskB = vdupq_n_u32(0xf800); - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - const uint32_t *pSource = pwSourceBase; - uint16_t *pTarget = phwTargetBase; - - blkCnt = ptCopySize->iWidth; -#ifdef USE_MVE_INTRINSICS - do { - mve_pred16_t tailPred = vctp32q(blkCnt); - - /* load a vector of 4 cccn888 pixels */ - uint32x4_t vecIn = vld1q_z(pSource, tailPred); - /* extract individual channels and place them according */ - /* to their relative position inside rgb565 */ - uint32x4_t vecR = (vecIn >> 3) & maskR; - uint32x4_t vecG = (vecIn >> 5) & maskG; - uint32x4_t vecB = (vecIn >> 8) & maskB; - /* merge */ - uint32x4_t vOut = vecR | vecG | vecB; - - /* store a vector of 4 rgb565 pixels */ - vstrhq_p_u32(pTarget, vOut, tailPred); - - pSource += 4; - pTarget += 4; - blkCnt -= 4; - } - while (blkCnt > 0); -#else - /* constants allowing to replace right shifts with fixed-point multiplications */ - /* enabling more beat overlap oportunities and reduce stalls */ - const int32_t inv_2pow3 = 1 << (31-3); /*1/2^3 in Q.31 */ - const int32_t inv_2pow5 = 1 << (31-5); /*1/2^5 in Q.31 */ - const int32_t inv_2pow8 = 1 << (31-8); /*1/2^8 in Q.31 */ - - __asm volatile( - " wlstp.32 lr, %[loopCnt], 1f \n" - /* precompute for allowing filling stalls in the inner loop */ - /* use vqdmulh to replace shifts to allow overlap with 'AND' */ - - /* load a vector of 4 cccn888 pixels */ - " vldrw.u32 q0, [%[pSource]], #16 \n" - /* mimic right shift by 3 */ - " vqdmulh.s32 q1, q0, %[inv_2pow3] \n" - - ".p2align 2 \n" - "2: \n" - " vand q1, q1, %[maskR] \n" - /* mimic right shift by 5 */ - " vqdmulh.s32 q2, q0, %[inv_2pow5] \n" - " vand q2, q2, %[maskG] \n" - /* mimic right shift by 8 */ - " vqdmulh.s32 q3, q0, %[inv_2pow8] \n" - /* accumulate R & G */ - " vorr q2, q1, q2 \n" - /* load next vector of 4 cccn888 pixels */ - " vldrw.u32 q0, [%[pSource]], #16 \n" - " vand q3, q3, %[maskB] \n" - /* mimic right shift by 3 */ - " vqdmulh.s32 q1, q0, %[inv_2pow3] \n" - /* accumulate B */ - " vorr q2, q2, q3 \n" - /* store a vector of 4 rgb565 pixels */ - " vstrh.32 q2, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - : [pSource] "+r"(pSource), [pTarget] "+r" (pTarget) - : [loopCnt] "r"(blkCnt), [inv_2pow3] "r" (inv_2pow3), - [inv_2pow5] "r" (inv_2pow5), [inv_2pow8] "r" (inv_2pow8), - [maskR] "t" (maskR),[maskG] "t" (maskG),[maskB] "t" (maskB) - : "q0", "q1", "q2", "q3", "memory", "r14" ); -#endif - - pwSourceBase += iSourceStride; - phwTargetBase += iTargetStride; - } -} - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_to_cccn888)(uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint32_t *__RESTRICT pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - int32_t blkCnt; - uint32x4_t maskRB = vdupq_n_u32(0xf8); - uint32x4_t maskG = vdupq_n_u32(0xfc00); - - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint16_t *__RESTRICT phwSource = phwSourceBase; - uint32_t *__RESTRICT pwTarget = pwTargetBase; - - blkCnt = ptCopySize->iWidth; -#ifdef USE_MVE_INTRINSICS - do { - mve_pred16_t tailPred = vctp32q(blkCnt); - - /* load a vector of 4 rgb565 pixels */ - uint32x4_t vecIn = vldrhq_z_u32(phwSource, tailPred); - /* extract individual channels and place them according position */ - uint32x4_t vecR = (vecIn << 3) & maskRB; - uint32x4_t vecG = (vecIn << 5) & maskG; - uint32x4_t vecB = ((vecIn >> 8) & maskRB) << 16; - /* merge and set n channel to 0xff */ - uint32x4_t vOut = 0xff000000 | vecR | vecG | vecB; - - /* store a vector of 4 cccn888 pixels */ - vst1q_p(pwTarget, vOut, tailPred); - - phwSource += 4; - pwTarget += 4; - blkCnt -= 4; - } - while (blkCnt > 0); - -#else - __asm volatile( - " wlstp.32 lr, %[loopCnt], 1f \n" - /* preload & precompute for allowing filling stalls in the inner loop */ - /* use vqdmulh & vmul to replace shifts to allow overlap with 'AND' */ - - /* load a vector of 4 rgb565 pixels */ - " vldrh.u32 q0, [%[pSource]], #8 \n" - /* mimic left shift by 3 */ - " vmul.u32 q1, q0, %[two_pow3] \n" - ".p2align 2 \n" - "2: \n" - /* mimic left shift by 5 */ - " vmul.u32 q2, q0, %[two_pow5] \n" - " vand q1, q1, %[maskRB] \n" - /* mimic right shift by 8 */ - " vqdmulh.s32 q3, q0, %[inv_2pow8] \n" - " vand q2, q2, %[maskG] \n" - /* accumulate G & R, use vmla instead of vorr for best overlap */ - " vmla.u32 q2, q1, %[one] \n" - " vand q3, q3, %[maskRB] \n" - /* accumulate B + left shift by 16 */ - " vmla.u32 q2, q3, %[two_pow16] \n" - /* load next vector of 4 rgb565 pixels */ - " vldrh.u32 q0, [%[pSource]], #8 \n" - /* merge and set n channel to 0xff */ - " vorr.i32 q2, #0xff000000 \n" - /* mimic left shift by 3 */ - " vmul.u32 q1, q0, %[two_pow3] \n" - /* store a vector of 4 cccn888 pixels */ - " vstrw.32 q2, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - - : [pSource] "+r"(phwSource), [pTarget] "+r" (pwTarget) - : [loopCnt] "r"(blkCnt),[two_pow3] "r" (1<<3), [two_pow5] "r" (1<<5), - [two_pow16] "r" (1<<16),[inv_2pow8] "r" (1 << (31-8)), - [maskRB] "t" (maskRB),[maskG] "t" (maskG), [one] "r" (1) - : "q0", "q1", "q2", "q3", "memory", "r14" ); -#endif - - phwSourceBase += iSourceStride; - pwTargetBase += iTargetStride; - } -} - -__OVERRIDE_WEAK -void __MVE_WRAPPER(__arm_2d_impl_cccn888_to_gray8)(uint32_t *__RESTRICT pwSourceBase, - int16_t iSourceStride, - uint8_t *__RESTRICT pchTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - int32_t blkCnt; - -#define ONE_THIRD_Q8 85 - -#ifdef USE_MVE_INTRINSICS - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - const uint32_t *pSource = pwSourceBase; - uint8_t *pTarget = pchTargetBase; - - blkCnt = ptCopySize->iWidth; - uint8x16_t vone_third = vdupq_n_u8(ONE_THIRD_Q8); - - do { - mve_pred16_t tailPred = vctp8q(blkCnt); - - /* load and de-interleave channels from 16 cccn888 pixels */ - uint8x16x4_t vecIn = vld4q_u8((const uint8_t *) pSource); - - /* Average R,G,B chans : scale by 1/3 and sum */ - vecIn.val[0] = vrmulhq(vecIn.val[0], vone_third); - vecIn.val[0] = vecIn.val[0] + vrmulhq(vecIn.val[1], vone_third); - vecIn.val[0] = vecIn.val[0] + vrmulhq(vecIn.val[2], vone_third); - - /* store a vector of 16 gray8 pixels */ - vstrbq_p_u8(pTarget, vecIn.val[0], tailPred); - - pSource += 16; - pTarget += 16; - blkCnt -= 16; - } - while (blkCnt > 0); - - pwSourceBase += iSourceStride; - pchTargetBase += iTargetStride; - } - -#else - if (ptCopySize->iWidth >= 32) { - /* use unrolled core loop for image with larger widths */ - /* because of helium sequence optimization opportunities */ - - /* residual size < 32 */ - int tailCnt = ptCopySize->iWidth & 0x1f; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - const uint32_t *pSource = pwSourceBase; - uint8_t *pTarget = pchTargetBase; - - blkCnt = ptCopySize->iWidth; - - /* de-interleave RGBA channels */ - /* Core is unrolled to enable overlap between load and scale/accumulate operations */ - /* handles block of 32-pixels line */ - __asm volatile( - " vld40.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld41.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld42.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld43.8 {q0, q1, q2, q3}, [%[pSource]]! \n" - ".p2align 2 \n" - " wls lr, %[loopCnt], 1f \n" - "2: \n" - /* overwrite unused Alpha channel */ - " vmov.i8 q3, %[one_third] \n" - /* de-interleave next 16 pixels block */ - /* load operations interleaved with scale of previously loaded channels */ - " vld40.8 {q4, q5, q6, q7}, [%[pSource]] \n" - " vrmulh.u8 q0, q0, q3 \n" - " vld41.8 {q4, q5, q6, q7}, [%[pSource]] \n" - " vrmulh.u8 q1, q1, q3 \n" - " vld42.8 {q4, q5, q6, q7}, [%[pSource]] \n" - " vadd.i8 q0, q0, q1 \n" - " vrmulh.u8 q2, q2, q3 \n" - " vld43.8 {q4, q5, q6, q7}, [%[pSource]]! \n" - " vadd.i8 q0, q0, q2 \n" - /* store 16 Gray8 pixels */ - " vstrb.8 q0, [%[pTarget]], #16 \n" - " vmov.i8 q7, %[one_third] \n" - " vrmulh.u8 q4, q4, q7 \n" - /* de-interleave next 16 pixels block */ - " vld40.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vrmulh.u8 q5, q5, q7 \n" - " vld41.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vadd.i8 q4, q4, q5 \n" - " vld42.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vrmulh.u8 q6, q6, q7 \n" - " vld43.8 {q0, q1, q2, q3}, [%[pSource]]! \n" - " vadd.i8 q4, q4, q6 \n" - /* store 16 Gray8 pixels */ - " vstrb.8 q4, [%[pTarget]], #16 \n" - " le lr, 2b \n" - "1: \n" - - /* tail handling for [0-31] pixels residual */ - /* 1/3 vector constant is in q7 and q0-q3 are already loaded */ - " wlstp.8 lr, %[tailCnt], 1f \n" - "2: \n" - " vrmulh.u8 q0, q0, q7 \n" - " vrmulh.u8 q1, q1, q7 \n" - " vrmulh.u8 q2, q2, q7 \n" - " vadd.i8 q0, q0, q1 \n" - " vadd.i8 q0, q0, q2 \n" - " vstrb.8 q0, [%[pTarget]], #16 \n" - " vld40.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld41.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld42.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld43.8 {q0, q1, q2, q3}, [%[pSource]]! \n" - " letp lr, 2b \n" - "1: \n" - :[pSource] "+r"(pSource),[pTarget] "+r"(pTarget) - :[loopCnt] "r" (blkCnt / 32),[one_third] "i"(ONE_THIRD_Q8), - [tailCnt] "r"(tailCnt) - :"q0", "q1", "q2", "q3", - "q4", "q5", "q6", "q7", - "memory", "r14"); - - pwSourceBase += iSourceStride; - pchTargetBase += iTargetStride; - } - } else { - /* iWidth lower than 32 */ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - const uint32_t *pSource = pwSourceBase; - uint8_t *pTarget = pchTargetBase; - - blkCnt = ptCopySize->iWidth; - - __asm volatile( - " vmov.i8 q4, %[one_third] \n" - ".p2align 2 \n" - " wlstp.8 lr, %[loopCnt], 1f \n" - "2: \n" - /* de-interleave RGBA channels */ - " vld40.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld41.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld42.8 {q0, q1, q2, q3}, [%[pSource]] \n" - " vld43.8 {q0, q1, q2, q3}, [%[pSource]]! \n" - /* scale and sum R,G,B chan */ - " vrmulh.u8 q0, q0, q4 \n" - " vrmulh.u8 q1, q1, q4 \n" - " vrmulh.u8 q2, q2, q4 \n" - " vadd.i8 q0, q0, q1 \n" - " vadd.i8 q0, q0, q2 \n" - /* store 16 Gray8 pixels */ - " vstrb.8 q0, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[pSource] "+r"(pSource),[pTarget] "+r"(pTarget) - :[loopCnt] "r" (blkCnt),[one_third] "i"(ONE_THIRD_Q8) - :"q0", "q1", "q2", "q3", - "q4", "memory", "r14"); - - pwSourceBase += iSourceStride; - pchTargetBase += iTargetStride; - } - } -#endif -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER(__arm_2d_impl_rgb565_to_gray8)( uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint8_t *__RESTRICT pchTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ -#define ONE_THIRD_Q16 21845 - - uint16x8_t vone_third = vdupq_n_u16(ONE_THIRD_Q16); - int32_t blkCnt; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint16_t *__RESTRICT phwSource = phwSourceBase; - uint8_t *__RESTRICT pTarget = pchTargetBase; - - blkCnt = ptCopySize->iWidth; -#ifdef USE_MVE_INTRINSICS - - do { - mve_pred16_t tailPred = vctp16q(blkCnt); - uint16x8_t R, G, B, vecGray8; - - /* load a vector of 8 rgb565 pixels */ - uint16x8_t vecIn = vld1q_z_u16(phwSource, tailPred); - - __arm_2d_rgb565_unpack_single_vec(vecIn, &R, &G, &B); - - /* sum R,G,B contributions */ - vecGray8 = R + G + B; - /* average */ - vecGray8 = vrmulhq(vecGray8, vone_third); - - /* store a vector of 8 x gray8 pixels */ - vstrbq_p_u16(pTarget, vecGray8, tailPred); - - phwSource += 8; - pTarget += 8; - blkCnt -= 8; - } - while (blkCnt > 0); - -#else - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - - __asm volatile( - /* preload pixel vector + mask R allowing more efficient pipelining */ - " vldrh.u16 q0, [%[pSource]], #16 \n" - /* R ch */ - " vand q1, q0, %[maskR] \n" - - - ".p2align 2 \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - /* G ch */ - " vshr.u16 q3, q0, #5 \n" - /* use vmul to replace left shift and allow overlap with vshr */ - " vmul.u16 q1, q1, %[two_pow3] \n" - /* B ch */ - " vshr.u16 q2, q0, #11 \n" - " vmul.u16 q2, q2, %[two_pow3] \n" - " vand q0, q3, %[maskG] \n" - - /* summing */ - " vmla.u16 q2, q0, %[four] \n" - " vadd.i16 q2, q1, q2 \n" - - /* load next RGB565 pixel vector */ - " vldrh.u16 q0, [%[pSource]], #16 \n" - /* averaging */ - " vrmulh.u16 q2, q2, %[vone_third] \n" - /* R */ - " vand q1, q0, %[maskR] \n" - /* store 8 Gray8 pixels */ - " vstrb.16 q2, [%[pTarget]], #8 \n" - - " letp lr, 2b \n" - "1: \n" - - : [pSource] "+r"(phwSource), [pTarget] "+r" (pTarget) - : [loopCnt] "r"(blkCnt),[two_pow3] "r" (1<<3), - [four] "r" (4), - [maskR] "t" (vecMaskR),[maskG] "t" (vecMaskG), - [vone_third] "t" (vone_third) - : "q0", "q1", "q2", "q3", "memory", "r14" ); - -#endif - - phwSourceBase += iSourceStride; - pchTargetBase += iTargetStride; - } -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER(__arm_2d_impl_gray8_to_rgb565)( uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - int32_t blkCnt; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint8_t *__RESTRICT pchSource = pchSourceBase; - uint16_t *__RESTRICT pTarget = phwTargetBase; - - blkCnt = ptCopySize->iWidth; -#ifdef USE_MVE_INTRINSICS - - do { - mve_pred16_t tailPred = vctp16q(blkCnt); - uint16x8_t vecRgb565; - - /* load a vector of 8 gray pixels */ - uint16x8_t vecGray8 = vldrbq_z_u16(pchSource, tailPred); - - /* replication in all RGB565 components */ - vecRgb565 =__arm_2d_rgb565_pack_single_vec(vecGray8, vecGray8, vecGray8); - - /* store a vector of 8 x RGB565 pixels */ - vst1q_p(pTarget, vecRgb565, tailPred); - - pchSource += 8; - pTarget += 8; - blkCnt -= 8; - } - while (blkCnt > 0); - -#else - - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecMaskGpck = vdupq_n_u16(0x00fc); - - __asm volatile( - ".p2align 2 \n" - - /* preload pixel vector + mask G allowing more efficient pipelining */ - " vldrb.u16 q0, [%[pSource]], #8 \n" - /* G ch */ - " vand q2, q0, %[maskG] \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - /* R ch */ - " vshr.u16 q1, q0, #3 \n" - /* use VMLA to mimick left shift combined with OR */ - " vmla.u16 q1, q2, %[eight] \n" - /* B ch */ - " vand q2, q0, %[maskB] \n" - " vmla.u16 q1, q2, %[twofiftysix] \n" - - /* load next Gray pixel vector */ - " vldrb.u16 q0, [%[pSource]], #8 \n" - /* G ch */ - " vand q2, q0, %[maskG] \n" - /* store 8 RGB565 pixels */ - " vstrh.16 q1, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - - : [pSource] "+r"(pchSource), [pTarget] "+r" (pTarget) - : [loopCnt] "r"(blkCnt),[twofiftysix] "r" (256), - [eight] "r" (8), - [maskG] "t" (vecMaskGpck),[maskB] "t" (vecMaskBpck) - : "q0", "q1", "q2", "q3", "memory", "r14" ); -#endif - - pchSourceBase += iSourceStride; - phwTargetBase += iTargetStride; - } -} - -__OVERRIDE_WEAK -void __MVE_WRAPPER(__arm_2d_impl_gray8_to_cccn888)(uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint32_t *__RESTRICT pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - int32_t blkCnt; - - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint8_t *__RESTRICT pchSource = pchSourceBase; - uint32_t *__RESTRICT pTarget = pwTargetBase; - - blkCnt = ptCopySize->iWidth; -#ifdef USE_MVE_INTRINSICS - - do { - mve_pred16_t tailPred = vctp32q(blkCnt); - uint32x4_t vecCcn888; - - /* load a vector of 4 gray8 pixels */ - uint32x4_t vecGray8 = vldrbq_z_u32(pchSource, tailPred); - - /* byte duplication inside 32-bit elements */ - /* and set alpha chan to 0xff */ - vecCcn888 = (vecGray8 * 0x00010101) | 0xff000000; - - /* store a vector of 4 x ccc888 pixels */ - vst1q_p(pTarget, vecCcn888, tailPred); - - pchSource += 4; - pTarget += 4; - blkCnt -= 4; - } - while (blkCnt > 0); - -#else - int tailCnt = ptCopySize->iWidth & 7; - - __asm volatile( - ".p2align 2 \n" - - /* preload pixel vector allowing more efficient pipelining */ - " vldrb.u32 q0, [%[pSource]], #4 \n" - - " wls lr, %[loopCnt], 1f \n" - "2: \n" - - " vmul.i32 q0, q0, %[byte_dup_cst] \n" - " vldrb.u32 q1, [%[pSource]], #4 \n" - " vorr.i32 q0, #0xff000000 \n" - /* store 4 CCN888 Gray8 pixels */ - " vstrw.32 q0, [%[pTarget]], #16 \n" - - " vmul.i32 q1, q1, %[byte_dup_cst] \n" - " vldrb.u32 q0, [%[pSource]], #4 \n" - " vorr.i32 q1, #0xff000000 \n" - /* store 4 CCN888 Gray8 pixels */ - " vstrw.32 q1, [%[pTarget]], #16 \n" - - " le lr, 2b \n" - "1: \n" - - /* tail handling for [0-7] pixel residual */ - /* q0 is already loaded */ - " wlstp.32 lr, %[tailCnt], 1f \n" - "2: \n" - " vmul.i32 q0, q0, %[byte_dup_cst] \n" - " vorr.i32 q0, #0xff000000 \n" - /* store 4 CCN888 Gray8 pixels */ - " vstrw.32 q0, [%[pTarget]], #16 \n" - " vldrb.u32 q0, [%[pSource]], #4 \n" - " letp lr, 2b \n" - "1: \n" - - : [pSource] "+r"(pchSource), [pTarget] "+r" (pTarget) - : [loopCnt] "r"(blkCnt/8),[byte_dup_cst] "r" (0x00010101), - [tailCnt] "r" (tailCnt) - : "q0", "memory", "r14" ); -#endif - - pchSourceBase += iSourceStride; - pwTargetBase += iTargetStride; - } -} - - -#ifdef __cplusplus -} -#endif - -#endif // __ARM_2D_HAS_HELIUM__ - -#endif // __ARM_2D_COMPILATION_UNIT diff --git a/package/Arm2D/Library/Source/__arm_2d_copy.inc b/package/Arm2D/Library/Source/__arm_2d_copy.inc deleted file mode 100644 index 82199a8a6..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_copy.inc +++ /dev/null @@ -1,1331 +0,0 @@ - -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_copy.inc - * Description: c code template for copy like operations - * - * $Date: 14. April 2020 - * $Revision: V.1.0.0 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_INT_TYPE -# error You have to define the __API_INT_TYPE before using this c template -#endif -#ifndef __API_INT_TYPE_BIT_NUM -# error You have to define the __API_INT_TYPE_BIT_NUM before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __arm_2d_impl_##__COLOUR##_##__NAME -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - - -#undef ____ARM_2D_TYPE -#undef ___ARM_2D_TYPE -#undef __ARM_2D_TYPE -#define ____ARM_2D_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -#define ___ARM_2D_TYPE(__NAME, __COLOUR) ____ARM_2D_TYPE(__NAME, __COLOUR) -#define __ARM_2D_TYPE(__NAME) ___ARM_2D_TYPE(__NAME, __API_COLOUR) - - - -/*----------------------------------------------------------------------------* - * Accelerable Low Level APIs * - *----------------------------------------------------------------------------*/ - -#if 0 -/*----------------------------------------------------------------------------* - * Fill with mirroring * - *----------------------------------------------------------------------------*/ - -void __ARM_2D_FUNC(fill_x_mirror)( __API_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize); - -void __ARM_2D_FUNC(fill_y_mirror)( __API_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize); - -void __ARM_2D_FUNC(fill_xy_mirror)( __API_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize); - -static -void __ARM_2D_FUNC(fill_generic)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptTargetSize, - const __ARM_2D_TYPE(paving_fct_t) * __RESTRICT pPavFct) -{ - __ARM_2D_MEM_FILL_GENERIC( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - pPavFct); -} - - -/*----------------------------------------------------------------------------* - * Copy with mirroring * - *----------------------------------------------------------------------------*/ -void __ARM_2D_FUNC(copy_x_mirror)( __API_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __ARM_2D_FUNC(copy_y_mirror)( __API_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __ARM_2D_FUNC(copy_xy_mirror)( __API_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -/*----------------------------------------------------------------------------* - * Paving * - *----------------------------------------------------------------------------*/ -__WEAK -void __ARM_2D_FUNC(2x2_paving)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK void __ARM_2D_FUNC(2x2_paving_x_mirror)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK void __ARM_2D_FUNC(2x2_paving_y_mirror)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__WEAK void __ARM_2D_FUNC(2x2_paving_xy_mirror)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK -void __ARM_2D_FUNC(1x2_paving)( const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__WEAK void __ARM_2D_FUNC(1x2_paving_x_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__WEAK void __ARM_2D_FUNC(1x2_paving_y_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK void __ARM_2D_FUNC(1x2_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK -void __ARM_2D_FUNC(2x1_paving)( const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__WEAK void __ARM_2D_FUNC(2x1_paving_x_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__WEAK void __ARM_2D_FUNC(2x1_paving_y_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK void __ARM_2D_FUNC(2x1_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - - -__WEAK -void __ARM_2D_FUNC(1x1_paving)(const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__WEAK void __ARM_2D_FUNC(1x1_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK void __ARM_2D_FUNC(1x1_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__WEAK void __ARM_2D_FUNC(1x1_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - - - -/*----------------------------------------------------------------------------* - * Copy * - *----------------------------------------------------------------------------*/ - - -__WEAK -void __ARM_2D_FUNC(copy)( __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - memcpy(pTarget, pSource, ptCopySize->iWidth * sizeof(*pSource)); - pSource += iSourceStride; - pTarget += iTargetStride; - } -} - - -__WEAK -void __ARM_2D_FUNC(copy_mirror)( __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __ARM_2D_FUNC(copy_x_mirror)( pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __ARM_2D_FUNC(copy_y_mirror)( pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR: - __ARM_2D_FUNC(copy_xy_mirror)(pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - -__WEAK -void __ARM_2D_FUNC(copy_y_mirror)( __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __ARM_2D_FUNC(1x1_paving_y_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -} - -__WEAK -void __ARM_2D_FUNC(copy_x_mirror)(__API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __ARM_2D_FUNC(1x1_paving_x_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -} - -__WEAK -void __ARM_2D_FUNC(copy_xy_mirror)( __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __ARM_2D_FUNC(1x1_paving_xy_mirror)(pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); - -} - - - -/*----------------------------------------------------------------------------* - * Fill * - *----------------------------------------------------------------------------*/ -__WEAK -void __ARM_2D_FUNC(fill)(__API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize) -{ - static const __ARM_2D_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(2x2_paving), - .pav_1x2 = &__ARM_2D_FUNC(1x2_paving), - .pav_2x1 = &__ARM_2D_FUNC(2x1_paving), - .pav_1x1 = &__ARM_2D_FUNC(1x1_paving) - }; - - __ARM_2D_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func); -} - -__WEAK -void __ARM_2D_FUNC(fill_mirror)( __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __ARM_2D_FUNC(fill_x_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __ARM_2D_FUNC(fill_y_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR : - __ARM_2D_FUNC(fill_xy_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - -__WEAK -void __ARM_2D_FUNC(fill_x_mirror)(__API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize) -{ - static __ARM_2D_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(2x2_paving_x_mirror), - .pav_1x2 = &__ARM_2D_FUNC(1x2_paving_x_mirror), - .pav_2x1 = &__ARM_2D_FUNC(2x1_paving_x_mirror), - .pav_1x1 = &__ARM_2D_FUNC(1x1_paving_x_mirror) - }; - - __ARM_2D_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, ptTargetSize, &pav_func); -} - -__WEAK void __ARM_2D_FUNC(fill_y_mirror)(__API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize) -{ - static __ARM_2D_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(2x2_paving_y_mirror), - .pav_1x2 = &__ARM_2D_FUNC(1x2_paving_y_mirror), - .pav_2x1 = &__ARM_2D_FUNC(2x1_paving_y_mirror), - .pav_1x1 = &__ARM_2D_FUNC(1x1_paving_y_mirror) - }; - - __ARM_2D_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, ptTargetSize, &pav_func); -} - - -__WEAK void __ARM_2D_FUNC(fill_xy_mirror)(__API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize) -{ - static __ARM_2D_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(2x2_paving_xy_mirror), - .pav_1x2 = &__ARM_2D_FUNC(1x2_paving_xy_mirror), - .pav_2x1 = &__ARM_2D_FUNC(2x1_paving_xy_mirror), - .pav_1x1 = &__ARM_2D_FUNC(1x1_paving_xy_mirror) - }; - - __ARM_2D_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, ptTargetSize, &pav_func); -} - -/*----------------------------------------------------------------------------* - * Copy with colour maksing and mirroring * - *----------------------------------------------------------------------------*/ -void __ARM_2D_FUNC(copy_colour_keying_x_mirror)( - __API_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour); - -void __ARM_2D_FUNC(copy_colour_keying_y_mirror)( - __API_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour); - -void __ARM_2D_FUNC(copy_colour_keying_xy_mirror)( - __API_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour); - - - -/*----------------------------------------------------------------------------* - * Fill with colour maksing and mirroring * - *----------------------------------------------------------------------------*/ - - void __ARM_2D_FUNC(fill_colour_keying_x_mirror)( - __API_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - __API_INT_TYPE Colour); - -void __ARM_2D_FUNC(fill_colour_keying_y_mirror)( - __API_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - __API_INT_TYPE Colour); - -void __ARM_2D_FUNC(fill_colour_keying_xy_mirror)( - __API_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - __API_INT_TYPE Colour); - -static -void __ARM_2D_FUNC(fill_colour_keying_generic)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptTargetSize, - const __ARM_2D_TYPE(cl_key_paving_fct_t) * __RESTRICT pPavFct, - uint_fast16_t hwColour) -{ - __ARM_2D_MEM_FILL_GENERIC( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - pPavFct, - hwColour); -} - - -/*----------------------------------------------------------------------------* - * Paving with colour masking * - *----------------------------------------------------------------------------*/ -__WEAK -void __ARM_2D_FUNC(cl_key_2x2_paving)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK void __ARM_2D_FUNC(cl_key_2x2_paving_x_mirror)( - const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK void __ARM_2D_FUNC(cl_key_2x2_paving_y_mirror)( - const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - -__WEAK void __ARM_2D_FUNC(cl_key_2x2_paving_xy_mirror)( - const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK -void __ARM_2D_FUNC(cl_key_1x2_paving)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - -__WEAK void __ARM_2D_FUNC(cl_key_1x2_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - -__WEAK void __ARM_2D_FUNC(cl_key_1x2_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK void __ARM_2D_FUNC(cl_key_1x2_paving_xy_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK -void __ARM_2D_FUNC(cl_key_2x1_paving)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - -__WEAK void __ARM_2D_FUNC(cl_key_2x1_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - -__WEAK void __ARM_2D_FUNC(cl_key_2x1_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK void __ARM_2D_FUNC(cl_key_2x1_paving_xy_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - - -__WEAK -void __ARM_2D_FUNC(cl_key_1x1_paving)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - -__WEAK void __ARM_2D_FUNC(cl_key_1x1_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK void __ARM_2D_FUNC(cl_key_1x1_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -__WEAK void __ARM_2D_FUNC(cl_key_1x1_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - (in != Colour)); -} - - -/*----------------------------------------------------------------------------* - * Copy with colour masking * - *----------------------------------------------------------------------------*/ - - -__WEAK -void __ARM_2D_FUNC(cl_key_copy)( - __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++){ - if (pSource[x] == Colour) { - continue; - } - pTarget[x] = pSource[x]; - } - pSource += iSourceStride; - pTarget += iTargetStride; - } -} - - -__WEAK -void __ARM_2D_FUNC(cl_key_copy_mirror)( - __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t wMode, - __API_INT_TYPE Colour) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __ARM_2D_FUNC(copy_colour_keying_x_mirror)( - pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize, - Colour); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __ARM_2D_FUNC(copy_colour_keying_y_mirror)( pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize, - Colour); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR: - __ARM_2D_FUNC(copy_colour_keying_xy_mirror)(pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize, - Colour); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - -__WEAK -void __ARM_2D_FUNC(copy_colour_keying_y_mirror)( - __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_FUNC(cl_key_1x1_paving_y_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - Colour); -} - -__WEAK -void __ARM_2D_FUNC(copy_colour_keying_x_mirror)( - __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_FUNC(cl_key_1x1_paving_x_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - Colour); -} - -__WEAK -void __ARM_2D_FUNC(copy_colour_keying_xy_mirror)( - __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_FUNC(cl_key_1x1_paving_xy_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - Colour); - -} - - -/*----------------------------------------------------------------------------* - * Fill with Colour Masking * - *----------------------------------------------------------------------------*/ - -__WEAK -void __ARM_2D_FUNC(cl_key_fill)(__API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - __API_INT_TYPE Colour) -{ - - static const __ARM_2D_TYPE(cl_key_paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(cl_key_2x2_paving), - .pav_1x2 = &__ARM_2D_FUNC(cl_key_1x2_paving), - .pav_2x1 = &__ARM_2D_FUNC(cl_key_2x1_paving), - .pav_1x1 = &__ARM_2D_FUNC(cl_key_1x1_paving), - }; - - __ARM_2D_FUNC(fill_colour_keying_generic)( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - Colour); - -} - -__WEAK -void __ARM_2D_FUNC(cl_key_fill_mirror)( - __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - uint32_t wMode, - __API_INT_TYPE Colour) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __ARM_2D_FUNC(fill_colour_keying_x_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize, - Colour); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __ARM_2D_FUNC(fill_colour_keying_y_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize, - Colour); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR : - __ARM_2D_FUNC(fill_colour_keying_xy_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize, - Colour); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - -__WEAK -void __ARM_2D_FUNC(fill_colour_keying_x_mirror)(__API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - __API_INT_TYPE Colour) -{ - static __ARM_2D_TYPE(cl_key_paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(cl_key_2x2_paving_x_mirror), - .pav_1x2 = &__ARM_2D_FUNC(cl_key_1x2_paving_x_mirror), - .pav_2x1 = &__ARM_2D_FUNC(cl_key_2x1_paving_x_mirror), - .pav_1x1 = &__ARM_2D_FUNC(cl_key_1x1_paving_x_mirror) - }; - - __ARM_2D_FUNC(fill_colour_keying_generic)( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - Colour); -} - -__WEAK void __ARM_2D_FUNC(fill_colour_keying_y_mirror)( - __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - __API_INT_TYPE Colour) -{ - static __ARM_2D_TYPE(cl_key_paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(cl_key_2x2_paving_y_mirror), - .pav_1x2 = &__ARM_2D_FUNC(cl_key_1x2_paving_y_mirror), - .pav_2x1 = &__ARM_2D_FUNC(cl_key_2x1_paving_y_mirror), - .pav_1x1 = &__ARM_2D_FUNC(cl_key_1x1_paving_y_mirror) - }; - - __ARM_2D_FUNC(fill_colour_keying_generic)( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - Colour); -} - - -__WEAK void __ARM_2D_FUNC(fill_colour_keying_xy_mirror)( - __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - __API_INT_TYPE Colour) -{ - static __ARM_2D_TYPE(cl_key_paving_fct_t) pav_func = { - .pav_2x2 = &__ARM_2D_FUNC(cl_key_2x2_paving_xy_mirror), - .pav_1x2 = &__ARM_2D_FUNC(cl_key_1x2_paving_xy_mirror), - .pav_2x1 = &__ARM_2D_FUNC(cl_key_2x1_paving_xy_mirror), - .pav_1x1 = &__ARM_2D_FUNC(cl_key_1x1_paving_xy_mirror) - }; - - __ARM_2D_FUNC(fill_colour_keying_generic)( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - Colour); -} - -#endif - - -/*----------------------------------------------------------------------------* - * Copy and Fill * - *----------------------------------------------------------------------------*/ - -#define __API_MCAF_COLOUR __API_COLOUR -#define __API_MCAF_INT_TYPE __API_INT_TYPE -#define __API_MCAF_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM - - -#include "__arm_2d_meta_copy_and_fill.inc" - - -__WEAK -void __ARM_2D_FUNC(copy)( __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - memcpy(pTarget, pSource, ptCopySize->iWidth * sizeof(*pSource)); - pSource += iSourceStride; - pTarget += iTargetStride; - } -} - - - -/*----------------------------------------------------------------------------* - * Copy and Fill with Colour Masking * - *----------------------------------------------------------------------------*/ - -#define __API_MCAF_COLOUR __API_COLOUR -#define __API_MCAF_INT_TYPE __API_INT_TYPE -#define __API_MCAF_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM - -#define __API_MCAF_OP_NAME cl_key -#define __API_MCAF_EXTRA_PARAM ,__API_MCAF_INT_TYPE Colour -#define __API_MCAF_EXTRA_EXPRESSION Colour -#define __API_MCAF_EXTRA_PAVE_EXPRESSION (in != Colour) - -#include "__arm_2d_meta_copy_and_fill.inc" - -__WEAK -void __ARM_2D_FUNC(cl_key_copy)( - __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++){ - if (pSource[x] == Colour) { - continue; - } - pTarget[x] = pSource[x]; - } - pSource += iSourceStride; - pTarget += iTargetStride; - } -} - - - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_INT_TYPE -#undef __API_INT_TYPE_BIT_NUM -#undef ____ARM_2D_TYPE -#undef ___ARM_2D_TYPE -#undef __ARM_2D_TYPE diff --git a/package/Arm2D/Library/Source/__arm_2d_copy_helium.inc b/package/Arm2D/Library/Source/__arm_2d_copy_helium.inc deleted file mode 100644 index e7c4ecdd0..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_copy_helium.inc +++ /dev/null @@ -1,809 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_copy_helium.inc - * Description: c code template for copy like operations - * - * $Date: 12 July 2022 - * $Revision: v1.0.0 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_INT_TYPE -# error You have to define the __API_INT_TYPE before using this c template -#endif -#ifndef __API_INT_TYPE_BIT_NUM -# error You have to define the __API_INT_TYPE_BIT_NUM before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__NAME) -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - - -#undef ____ARM_2D_TYPE -#undef ___ARM_2D_TYPE -#undef __ARM_2D_TYPE -#define ____ARM_2D_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -#define ___ARM_2D_TYPE(__NAME, __COLOUR) ____ARM_2D_TYPE(__NAME, __COLOUR) -#define __ARM_2D_TYPE(__NAME) ___ARM_2D_TYPE(__NAME, __API_COLOUR) - - - - -/*----------------------------------------------------------------------------* - * Paving * - *----------------------------------------------------------------------------*/ - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(2x2_paving)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(2x2_paving_x_mirror)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(2x2_paving_y_mirror)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(2x2_paving_xy_mirror)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK - -void __ARM_2D_FUNC(1x2_paving)( const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(1x2_paving_x_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(1x2_paving_y_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(1x2_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK - -void __ARM_2D_FUNC(2x1_paving)( const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(2x1_paving_x_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(2x1_paving_y_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(2x1_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - - -__OVERRIDE_WEAK - -void __ARM_2D_FUNC(1x1_paving)(const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(1x1_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(1x1_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(1x1_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM)); -} - - -/*----------------------------------------------------------------------------* - * Paving with colour masking * - *----------------------------------------------------------------------------*/ -__OVERRIDE_WEAK - -void __ARM_2D_FUNC(cl_key_2x2_paving)(const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_2x2_paving_x_mirror)( - const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_2x2_paving_y_mirror)( - const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_2x2_paving_xy_mirror)( - const __API_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK - -void __ARM_2D_FUNC(cl_key_1x2_paving)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_1x2_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_1x2_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_1x2_paving_xy_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x2(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK - -void __ARM_2D_FUNC(cl_key_2x1_paving)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_2x1_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_2x1_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_2x1_paving_xy_mirror)( - const __API_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_2x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - - -__OVERRIDE_WEAK - -void __ARM_2D_FUNC(cl_key_1x1_paving)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_1x1_paving_x_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_1x1_paving_y_mirror)( - const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_1x1_paving_xy_mirror)(const __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_PAVING_1x1(__API_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_INT_TYPE_BIT_NUM), - CMP_CL_MSK(__API_INT_TYPE_BIT_NUM, Colour)); -} - - - -/*----------------------------------------------------------------------------* - * Copy with colour masking * - *----------------------------------------------------------------------------*/ - - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_copy)( - __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_FUNC(cl_key_1x1_paving)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - Colour); -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_copy_y_mirror)( - __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_FUNC(cl_key_1x1_paving_y_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - Colour); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_copy_x_mirror)( - __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_FUNC(cl_key_1x1_paving_x_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - Colour); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(cl_key_copy_xy_mirror)( - __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - __ARM_2D_FUNC(cl_key_1x1_paving_xy_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - Colour); - -} - -/*----------------------------------------------------------------------------* - * Copy * - *----------------------------------------------------------------------------*/ - -#if __API_INT_TYPE_BIT_NUM == 8 - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(copy)( __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - __ARM_2D_FUNC(1x1_paving)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -} - -#endif - -/*----------------------------------------------------------------------------* - * Copy with mirroring * - *----------------------------------------------------------------------------*/ - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(copy_y_mirror)( __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __ARM_2D_FUNC(1x1_paving_y_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(copy_x_mirror)(__API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __ARM_2D_FUNC(1x1_paving_x_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -} - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(copy_xy_mirror)( __API_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __ARM_2D_FUNC(1x1_paving_xy_mirror)(pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); - -} - - - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_INT_TYPE -#undef __API_INT_TYPE_BIT_NUM -#undef ____ARM_2D_TYPE -#undef ___ARM_2D_TYPE -#undef __ARM_2D_TYPE - diff --git a/package/Arm2D/Library/Source/__arm_2d_core.c b/package/Arm2D/Library/Source/__arm_2d_core.c deleted file mode 100644 index 6b2faaaca..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_core.c +++ /dev/null @@ -1,2086 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm-2d_core.c - * Description: Basic Tile operations - * - * $Date: 29. Aug 2022 - * $Revision: V.1.3.1 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -/*============================ INCLUDES ======================================*/ - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wempty-translation-unit" -#endif - -#ifdef __ARM_2D_COMPILATION_UNIT -#undef __ARM_2D_COMPILATION_UNIT - -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wgnu-statement-expression" -# pragma clang diagnostic ignored "-Wswitch-enum" -# pragma clang diagnostic ignored "-Wswitch" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 174,177,188,68,513 -#elif defined(__IS_COMPILER_IAR__) -# pragma diag_suppress=Pa089 -#elif defined(__IS_COMPILER_GCC__) -# pragma GCC diagnostic ignored "-Wenum-compare" -# pragma GCC diagnostic ignored "-Wpedantic" -# pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ - -__WEAK -arm_2d_runtime_feature_t ARM_2D_RUNTIME_FEATURE = { - .TREAT_OUT_OF_RANGE_AS_COMPLETE = 1, - .HAS_DEDICATED_THREAD_FOR_2D_TASK = 0, -}; - - -const arm_2d_version_t ARM_2D_VERSION = { - .Major = ARM_2D_VERSION_MAJOR, - .Minor = ARM_2D_VERSION_MINOR, - .Patch = ARM_2D_VERSION_PATCH, -}; - -/*============================ PROTOTYPES ====================================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - -ARM_NOINIT -struct __arm_2d_op_control ARM_2D_CTRL; - -#define __arm_2d_get_address_and_region_from_tile( __TILE_PTR, \ - __VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR, \ - __TYPE, \ - __BUF_PTR_NAME) \ - arm_2d_region_t __VALID_REGION_NAME; \ - assert(NULL != (__TILE_PTR)); \ - __TYPE *(__BUF_PTR_NAME) = NULL; \ - \ - (__TILE_PTR) = arm_2d_tile_get_root((__TILE_PTR), \ - &__VALID_REGION_NAME, \ - __LOCATION_OFFSET_PTR); \ - \ - if (NULL != (__TILE_PTR)) { \ - (__BUF_PTR_NAME) = ((__TYPE *)((__TILE_PTR)->pchBuffer)) \ - + (__TILE_PTR)->tRegion.tSize.iWidth * \ - __VALID_REGION_NAME.tLocation.iY \ - + __VALID_REGION_NAME.tLocation.iX; \ - } - - - -/*----------------------------------------------------------------------------* - * Virtual Resource * - *----------------------------------------------------------------------------*/ -static arm_2d_err_t __load_virtual_resource(const arm_2d_tile_t *ptRootTile, - __arm_2d_tile_param_t *ptParam) -{ - if (NULL == ptRootTile || NULL == ptParam) { - return ARM_2D_ERR_NONE; - } - - if (!ptRootTile->tInfo.bIsRoot) { - return ARM_2D_ERR_NONE; - } - - if (!ptRootTile->tInfo.bVirtualResource) { - return ARM_2D_ERR_NONE; - } - - /* a virtual resource must be marked as root tile */ - arm_2d_vres_t *ptRes = (arm_2d_vres_t *)ptRootTile; - - if (NULL == ptRes->Load) { - return ARM_2D_ERR_MISSING_PARAM; - } - - /* load virtual resource */ - intptr_t nAddress = (ptRes->Load)( ptRes->pTarget, - ptRes, - &ptParam->tValidRegion); - - if ((intptr_t)NULL == nAddress) { - return ARM_2D_ERR_IO_ERROR; - } - - ptRes->tTile.nAddress = nAddress; - /* update param */ - ptParam->pBuffer = (void *)nAddress; - ptParam->nOffset = 0; - ptParam->iStride = ptParam->tValidRegion.tSize.iWidth; - ptParam->tValidRegion.tLocation = (arm_2d_location_t){0,0}; - - return ARM_2D_ERR_NONE; -} - -static void __depose_virtual_resource(const arm_2d_tile_t *ptSourceTile) -{ - if (NULL == ptSourceTile) { - return; - } - arm_2d_region_t tValidRegion; - ptSourceTile = __arm_2d_tile_get_root( ptSourceTile, - &tValidRegion, - NULL, - NULL); - - if (NULL == ptSourceTile) { - return ; - } - - if (!ptSourceTile->tInfo.bVirtualResource) { - return ; - } - - /* a virtual resource must be marked as root tile */ - arm_2d_vres_t *ptRes = (arm_2d_vres_t *)ptSourceTile; - - intptr_t nAddress = ptRes->tTile.nAddress; - ptRes->tTile.nAddress = (intptr_t)NULL; - - - - if (NULL == ptRes->Depose) { - return ; - } - - /* depose virtual resource */ - (ptRes->Depose)(ptRes->pTarget, ptRes, nAddress); -} - -/*----------------------------------------------------------------------------* - * Invoking Low level operations * - *----------------------------------------------------------------------------*/ - -void __arm_2d_sub_task_depose(arm_2d_op_core_t *ptOP) -{ - assert(NULL != ptOP); - switch(ptOP->ptOp->Info.Param.chValue & ARM_2D_OP_INFO_PARAM_TILES_MASK) { - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK: { - arm_2d_op_msk_t *ptThis = (arm_2d_op_msk_t *)ptOP; - __depose_virtual_resource(this.Mask.ptTile); - } - break; - - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE: { - arm_2d_op_src_t *ptThis = (arm_2d_op_src_t *)ptOP; - __depose_virtual_resource(this.Source.ptTile); - } - break; - - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK: - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK: - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK: { - arm_2d_op_src_msk_t *ptThis = (arm_2d_op_src_msk_t *)ptOP; - __depose_virtual_resource(this.Source.ptTile); - __depose_virtual_resource(this.Mask.ptSourceSide); - __depose_virtual_resource(this.Mask.ptTargetSide); - } - break; - - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_ORIGIN:{ - arm_2d_op_src_orig_t *ptThis = (arm_2d_op_src_orig_t *)ptOP; - __depose_virtual_resource(this.Origin.ptTile); - } - break; - - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_ORIGIN - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK: - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_ORIGIN - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK: - case ARM_2D_OP_INFO_PARAM_HAS_TARGET - | ARM_2D_OP_INFO_PARAM_HAS_ORIGIN - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK - | ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK: { - arm_2d_op_src_orig_msk_t *ptThis = (arm_2d_op_src_orig_msk_t *)ptOP; - __depose_virtual_resource(this.Origin.ptTile); - __depose_virtual_resource(this.Mask.ptOriginSide); - __depose_virtual_resource(this.Mask.ptTargetSide); - } - break; - } -} - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_tile_process( - arm_2d_op_t *ptThis, - __arm_2d_tile_param_t *ptParam) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tTileProcess = *ptParam, - }; - - /* todo: update the tile process interface */ - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT( 0, __arm_2d_io_func_t); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - return tResult; -} - - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_fill( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptTarget) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tFill = { - .tSource = *ptSource, - .tTarget = *ptTarget, - }, - }; - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT( 1,__arm_2d_io_func_t ); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - - return tResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_fill_with_mask( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptSourceMask, - __arm_2d_tile_param_t *ptTarget, - __arm_2d_tile_param_t *ptTargetMask) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tFillMask = { - .use_as____arm_2d_param_fill_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - }, - }, - }; - - if (NULL == ptSourceMask){ - ptTask->Param.tFillMask.tSrcMask.bInvalid = true; - } else { - ptTask->Param.tFillMask.tSrcMask = *ptSourceMask; - } - - if (NULL == ptTargetMask){ - ptTask->Param.tFillMask.tDesMask.bInvalid = true; - } else { - ptTask->Param.tFillMask.tDesMask = *ptTargetMask; - } - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT( 1,__arm_2d_io_func_t ); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - - return tResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy(arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptTarget, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tCopy = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - }; - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT(0,__arm_2d_io_func_t ); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - - return tResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy_with_mask( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptSourceMask, - __arm_2d_tile_param_t *ptTarget, - __arm_2d_tile_param_t *ptTargetMask, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tCopyMask = { - .use_as____arm_2d_param_copy_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - }, - }; - - if (NULL == ptSourceMask){ - ptTask->Param.tCopyMask.tSrcMask.bInvalid = true; - } else { - ptTask->Param.tCopyMask.tSrcMask = *ptSourceMask; - } - - if (NULL == ptTargetMask){ - ptTask->Param.tCopyMask.tDesMask.bInvalid = true; - } else { - ptTask->Param.tCopyMask.tDesMask = *ptTargetMask; - } - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT(0,__arm_2d_io_func_t ); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - return tResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_fill_origin( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptOrigin, - __arm_2d_tile_param_t *ptTarget) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - - - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tFillOrig = { - .use_as____arm_2d_param_fill_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - }, - .tOrigin = *ptOrigin, - }, - }; - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT( 1,__arm_2d_io_func_t ); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - return tResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy_origin( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptOrigin, - __arm_2d_tile_param_t *ptTarget, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tCopyOrig = { - .use_as____arm_2d_param_copy_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - .tOrigin = *ptOrigin, - }, - }; - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT(0,__arm_2d_io_func_t ); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - return tResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy_origin_masks( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptOrigin, - __arm_2d_tile_param_t *ptOriginMask, - __arm_2d_tile_param_t *ptTarget, - __arm_2d_tile_param_t *ptTargetMask, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - __arm_2d_sub_task_t *ptTask = &(__arm_2d_sub_task_t){ - .ptOP = (arm_2d_op_core_t *)ptThis, - .Param.tCopyOrigMask = { - .use_as____arm_2d_param_copy_orig_t = { - .use_as____arm_2d_param_copy_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - - .tOrigin = *ptOrigin, - }, - .tOrigMask = *ptOriginMask, - .tDesMask = *ptTargetMask, - }, - }; - - /* call default software implementation */ - ARM_2D_RUN_DEFAULT(0,__arm_2d_io_func_t ); - - __arm_2d_sub_task_depose((arm_2d_op_core_t *)ptThis); - return tResult; -} - -/*----------------------------------------------------------------------------* - * Region Calculation * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(1,2) -static const arm_2d_tile_t * __arm_2d_tile_region_caculator( - const arm_2d_tile_t *ptTile, - __arm_2d_tile_param_t *ptOut, - uint_fast8_t *pchPixelLenInBit, - bool bAllowEnforcedColour, - uint32_t wMode) -{ - arm_2d_region_t tValidRegion; - int32_t nOffset = 0; - uint8_t *pchBuffer = NULL; - - assert(NULL != ptTile); - assert(NULL != ptOut); - - - - //memset(ptOut, 0, sizeof(__arm_2d_tile_param_t)); - - ptTile = __arm_2d_tile_get_root( ptTile, - &tValidRegion, - NULL, - &ptOut->ptDerivedResource); - - bool bDerivedResource = false; - - if (NULL != ptOut->ptDerivedResource) { - if (!ptOut->ptDerivedResource->tInfo.bIsRoot) { - bDerivedResource = true; - } - } - - if (NULL != ptTile) { - - //! check if enforced colour is allowed - if (bAllowEnforcedColour) { - if (ptTile->tInfo.bHasEnforcedColour) { - *pchPixelLenInBit = _BV(ptTile->tInfo.tColourInfo.u3ColourSZ); - } - } - - uint_fast8_t chPixelLenInBit = *pchPixelLenInBit; - - arm_2d_location_t tOffset = tValidRegion.tLocation; - - /* root tile can have offset location */ - tOffset.iX -= ptTile->tRegion.tLocation.iX; - tOffset.iY -= ptTile->tRegion.tLocation.iY; - - if ((wMode) & ARM_2D_CP_MODE_X_MIRROR) { - tOffset.iX = 0; - } - if ((wMode) & ARM_2D_CP_MODE_Y_MIRROR) { - tOffset.iY = 0; - } - - if (chPixelLenInBit >= 8) { - nOffset = ptTile->tRegion.tSize.iWidth * tOffset.iY + tOffset.iX; - pchBuffer = ptTile->pchBuffer - + (nOffset * chPixelLenInBit >> 3); - } else { - - nOffset = tOffset.iX; - - pchBuffer = ptTile->pchBuffer - + ((ptTile->tRegion.tSize.iWidth - * chPixelLenInBit + 7) >> 3) * tOffset.iY - + ((tOffset.iX * chPixelLenInBit) >> 3); - } - - ptOut->iStride = ptTile->tRegion.tSize.iWidth; - ptOut->nOffset = nOffset; - ptOut->pBuffer = pchBuffer; - ptOut->tValidRegion = tValidRegion; - ptOut->tColour.chScheme = ptTile->tColourInfo.chScheme; - ptOut->bDerivedResource = bDerivedResource; - ptOut->bInvalid = false; - } - - return ptTile; -} - -ARM_NONNULL(1,2) -static -arm_fsm_rt_t __arm_2d_tile_process( arm_2d_op_t *ptThis, - const arm_2d_tile_t *ptTarget) -{ - assert(NULL != ptTarget); - assert(OP_CORE.ptOp->Info.Colour.u3ColourSZ >= ARM_2D_COLOUR_SZ_8BIT); - - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - - uint_fast8_t chPixelLenInBit = _BV(OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_tile_param_t tTileParam; - __arm_2d_tile_region_caculator( - ptTarget, - &tTileParam, - &chPixelLenInBit, - OP_CORE.ptOp->Info.Param.bAllowEnforcedColour, - 0); - - tResult = __arm_2d_issue_sub_task_tile_process( ptThis, &tTileParam); - - return tResult; -} - - -static void __arm_2d_source_side_tile_mirror_preprocess( - const arm_2d_tile_t *ptTile, - __arm_2d_tile_param_t *ptTileParam, - uint_fast8_t chPixelLenInBit, - const arm_2d_size_t *ptActualSize, - uint32_t wMode) -{ - //! right and/or bottom alignment - arm_2d_location_t tOffset = {0}; - - if (ptTileParam->bDerivedResource) { - //!< treat the content inside the valid region as the one to be mirrored - //! right alignment - if (wMode & ARM_2D_CP_MODE_X_MIRROR) { - - tOffset.iX = ptTileParam->ptDerivedResource->tRegion.tLocation.iX; - tOffset.iX += ( ptTileParam->ptDerivedResource->tRegion.tLocation.iX - + ptTileParam->ptDerivedResource->tRegion.tSize.iWidth) - - ( ptTileParam->tValidRegion.tLocation.iX - + ptActualSize->iWidth); - - ptTileParam->tValidRegion.tLocation.iX = tOffset.iX; - } - - //! bottom alignment - if (wMode & ARM_2D_CP_MODE_Y_MIRROR) { - tOffset.iY = ptTileParam->ptDerivedResource->tRegion.tLocation.iY; - tOffset.iY += ( ptTileParam->ptDerivedResource->tRegion.tLocation.iY - + ptTileParam->ptDerivedResource->tRegion.tSize.iHeight) - - ( ptTileParam->tValidRegion.tLocation.iY - + ptActualSize->iHeight); - ptTileParam->tValidRegion.tLocation.iY = tOffset.iY; - } - } else { - - //!< treat valid region as a logic region to indicate the area for mirroring. - //! right alignment - if (wMode & ARM_2D_CP_MODE_X_MIRROR) { - tOffset.iX = ptTile->tRegion.tSize.iWidth - - ( ptTileParam->tValidRegion.tLocation.iX - + ptActualSize->iWidth); - ptTileParam->tValidRegion.tLocation.iX = tOffset.iX; - } - - //! bottom alignment - if (wMode & ARM_2D_CP_MODE_Y_MIRROR) { - tOffset.iY = ptTile->tRegion.tSize.iHeight - - ( ptTileParam->tValidRegion.tLocation.iY - + ptActualSize->iHeight); - ptTileParam->tValidRegion.tLocation.iY = tOffset.iY; - } - } - - if (chPixelLenInBit >= 8) { - - ptTileParam->nOffset += ( tOffset.iY * ptTile->tRegion.tSize.iWidth - + tOffset.iX); - - ptTileParam->pBuffer = ptTile->pchBuffer - + (ptTileParam->nOffset * chPixelLenInBit >> 3); - } else { - ptTileParam->nOffset += tOffset.iX; - - (*(uintptr_t *)&(ptTileParam->pBuffer)) += - + ((ptTile->tRegion.tSize.iWidth - * chPixelLenInBit + 7) >> 3) * tOffset.iY - + ((tOffset.iX * chPixelLenInBit) >> 3); - } -} - -ARM_NONNULL(1,2) -static -arm_fsm_rt_t __arm_2d_region_calculator( arm_2d_op_cp_t *ptThis, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptTargetMask, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - //assert(OP_CORE.ptOp->Info.Colour.u3ColourSZ >= ARM_2D_COLOUR_SZ_8BIT); - - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - uint_fast8_t chTargetPixelLenInBit = _BV(OP_CORE.ptOp->Info.Colour.u3ColourSZ); - uint_fast8_t chSourcePixelLenInBit = chTargetPixelLenInBit; - uint_fast8_t chOriginPixelLenInBit = chTargetPixelLenInBit; - uint_fast8_t chSourceMaskPixelLenInBit = 8; - - __arm_2d_tile_param_t tSourceTileParam; - __arm_2d_tile_param_t tSourceMaskParam; - __arm_2d_tile_param_t tTargetTileParam; - __arm_2d_tile_param_t tTargetMaskParam; - __arm_2d_tile_param_t tOriginTileParam; - arm_2d_tile_t tSourceMask; - arm_2d_tile_t tTargetMask; - - //const arm_2d_tile_t *ptTargetMask = NULL; - //const arm_2d_tile_t *ptSourceMask = NULL; - - const arm_2d_tile_t *ptOrigin = NULL; - - if (OP_CORE.ptOp->Info.Param.bHasOrigin) { - arm_2d_op_src_orig_t *ptOP = (arm_2d_op_src_orig_t *)ptThis; - //uint_fast8_t chOriginPixelLenInBit = chSourcePixelLenInBit; - ptOrigin = __arm_2d_tile_region_caculator( - ptOP->Origin.ptTile, - &tOriginTileParam, - &chOriginPixelLenInBit, - OP_CORE.ptOp->Info.Param.bAllowEnforcedColour, - wMode); - - if (NULL == ptOrigin) { - return (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - } - } - - ptSource = __arm_2d_tile_region_caculator( - ptSource, - &tSourceTileParam, - &chSourcePixelLenInBit, - OP_CORE.ptOp->Info.Param.bAllowEnforcedColour, - wMode); - - - - ptTarget = __arm_2d_tile_region_caculator( - ptTarget, - &tTargetTileParam, - &chTargetPixelLenInBit, - false, - 0); - - if (NULL == ptSource || NULL == ptTarget) { - return (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - } - - - if (!OP_CORE.ptOp->Info.Param.bHasOrigin) { //!< no origin - if (OP_CORE.ptOp->Info.Param.bHasSrcMask) { - arm_2d_op_src_msk_t *ptOP = (arm_2d_op_src_msk_t *)ptThis; - - ptSourceMask = ptOP->Mask.ptSourceSide; - - if (NULL != ptSourceMask) { - ptSourceMask = arm_2d_tile_generate_child( - ptSourceMask, - &tSourceTileParam.tValidRegion, - &tSourceMask, - false); - - ptSourceMask = __arm_2d_tile_region_caculator( - ptSourceMask, - &tSourceMaskParam, - &chSourceMaskPixelLenInBit, - true, - wMode); - } - } - - if (OP_CORE.ptOp->Info.Param.bHasDesMask) { - arm_2d_op_src_msk_t *ptOP = (arm_2d_op_src_msk_t *)ptThis; - ptTargetMask = ptOP->Mask.ptTargetSide; - if (NULL != ptTargetMask) { - uint_fast8_t chTargetMaskPixelLenInBit = 8; - - do { - arm_2d_region_t tTempRegion= { - .tSize = ptThis->Target.ptTile->tRegion.tSize, - }; - - arm_2d_get_absolute_location(ptThis->Target.ptTile, - &tTempRegion.tLocation); - - tTempRegion.tLocation.iX - = tTargetTileParam.tValidRegion.tLocation.iX - - tTempRegion.tLocation.iX; - - tTempRegion.tSize.iWidth - = tTargetTileParam.tValidRegion.tSize.iWidth - - tTempRegion.tSize.iWidth; - - - arm_2d_region_t tNewTargetMaskRegion = ptTargetMask->tRegion; - - tNewTargetMaskRegion.tLocation.iX += tTempRegion.tLocation.iX; - tNewTargetMaskRegion.tSize.iWidth += tTempRegion.tSize.iWidth; - - // when the target mask is not 1-horizontal line mask - if (ptTargetMask->tRegion.tSize.iHeight != 1 ) { - tTempRegion.tLocation.iY - = tTargetTileParam.tValidRegion.tLocation.iY - - tTempRegion.tLocation.iY; - - tTempRegion.tSize.iHeight - = tTargetTileParam.tValidRegion.tSize.iHeight - - tTempRegion.tSize.iHeight; - - - tNewTargetMaskRegion.tLocation.iY += tTempRegion.tLocation.iY; - tNewTargetMaskRegion.tSize.iHeight += tTempRegion.tSize.iHeight; - } - - ptTargetMask = arm_2d_tile_generate_child( - ptTargetMask, - &tNewTargetMaskRegion, - &tTargetMask, - false); - - } while(0); - - - ptTargetMask = __arm_2d_tile_region_caculator( - ptTargetMask, - &tTargetMaskParam, - &chTargetMaskPixelLenInBit, - true, - 0); - } - } - } else { //!< has origin - if (OP_CORE.ptOp->Info.Param.bHasSrcMask) { - arm_2d_op_src_orig_msk_t *ptOP = (arm_2d_op_src_orig_msk_t *)ptThis; - - ptSourceMask = ptOP->Mask.ptOriginSide; - - if (NULL != ptSourceMask) { - ptSourceMask = arm_2d_tile_generate_child( - ptSourceMask, - &tOriginTileParam.tValidRegion, - &tSourceMask, - false); - - ptSourceMask = __arm_2d_tile_region_caculator( - ptSourceMask, - &tSourceMaskParam, - &chSourceMaskPixelLenInBit, - true, - wMode); - } - } - - if (OP_CORE.ptOp->Info.Param.bHasDesMask) { - arm_2d_op_src_orig_msk_t *ptOP = (arm_2d_op_src_orig_msk_t *)ptThis; - ptTargetMask = ptOP->Mask.ptTargetSide; - if (NULL != ptTargetMask) { - uint_fast8_t chTargetMaskPixelLenInBit = 8; - - do { - arm_2d_region_t tTempRegion= { - .tSize = ptThis->Target.ptTile->tRegion.tSize, - }; - - arm_2d_get_absolute_location(ptThis->Target.ptTile, - &tTempRegion.tLocation); - - tTempRegion.tLocation.iX - = tTargetTileParam.tValidRegion.tLocation.iX - - tTempRegion.tLocation.iX; - - tTempRegion.tSize.iWidth - = tTargetTileParam.tValidRegion.tSize.iWidth - - tTempRegion.tSize.iWidth; - - - arm_2d_region_t tNewTargetMaskRegion = ptTargetMask->tRegion; - - tNewTargetMaskRegion.tLocation.iX += tTempRegion.tLocation.iX; - tNewTargetMaskRegion.tSize.iWidth += tTempRegion.tSize.iWidth; - - // when the target mask is not 1-horizontal line mask - if (ptTargetMask->tRegion.tSize.iHeight != 1 ) { - tTempRegion.tLocation.iY - = tTargetTileParam.tValidRegion.tLocation.iY - - tTempRegion.tLocation.iY; - - tTempRegion.tSize.iHeight - = tTargetTileParam.tValidRegion.tSize.iHeight - - tTempRegion.tSize.iHeight; - - - tNewTargetMaskRegion.tLocation.iY += tTempRegion.tLocation.iY; - tNewTargetMaskRegion.tSize.iHeight += tTempRegion.tSize.iHeight; - } - - ptTargetMask = arm_2d_tile_generate_child( - ptTargetMask, - &tNewTargetMaskRegion, - &tTargetMask, - false); - - } while(0); - - - ptTargetMask = __arm_2d_tile_region_caculator( - ptTargetMask, - &tTargetMaskParam, - &chTargetMaskPixelLenInBit, - true, - 0); - } - } - } - - arm_2d_size_t tActualSize = { - .iWidth = MIN( tSourceTileParam.tValidRegion.tSize.iWidth, - tTargetTileParam.tValidRegion.tSize.iWidth), - .iHeight = MIN( tSourceTileParam.tValidRegion.tSize.iHeight, - tTargetTileParam.tValidRegion.tSize.iHeight), - }; - - /* trim source valid region */ - tSourceTileParam.tValidRegion.tSize = tActualSize; - - if (wMode & ARM_2D_CP_MODE_FILL) { //!< tiling (tile fill) operation - - if (OP_CORE.ptOp->Info.Param.bHasOrigin) { - /*! \brief masks are not supported in fill with origin mode */ - assert(!OP_CORE.ptOp->Info.Param.bHasSrcMask); - assert(!OP_CORE.ptOp->Info.Param.bHasDesMask); - - //! handle mirroring - do { - __arm_2d_source_side_tile_mirror_preprocess( - ptOrigin, - &tOriginTileParam, - chOriginPixelLenInBit, - &tOriginTileParam.tValidRegion.tSize, - wMode); - - /*! \note NOT SUPPORTED YET - if ( OP_CORE.ptOp->Info.Param.bHasSrcMask - && (NULL != ptSourceMask)) { - __arm_2d_source_side_tile_mirror_preprocess( - ptSourceMask, - &tSourceMaskParam, - chSourceMaskPixelLenInBit, - &tSourceMaskParam.tValidRegion.tSize, - wMode); - } - */ - } while(0); - - /* load virtual resource if any */ - do { - arm_2d_err_t tErr = - __load_virtual_resource(ptOrigin, &tOriginTileParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - } while(0); - - tResult = __arm_2d_issue_sub_task_fill_origin( - ptThis, - &tSourceTileParam, - &tOriginTileParam, - &tTargetTileParam); - } else { - - //! handle mirroring - do { - __arm_2d_source_side_tile_mirror_preprocess( - ptSource, - &tSourceTileParam, - chSourcePixelLenInBit, - &tSourceTileParam.tValidRegion.tSize, - wMode); - - if ( OP_CORE.ptOp->Info.Param.bHasSrcMask - && (NULL != ptSourceMask)) { - __arm_2d_source_side_tile_mirror_preprocess( - ptSourceMask, - &tSourceMaskParam, - chSourceMaskPixelLenInBit, - &tSourceMaskParam.tValidRegion.tSize, - wMode); - } - } while(0); - - /* trim source mask valid region */ - if (NULL != ptSourceMask) { - tSourceMaskParam.tValidRegion.tSize.iWidth = - MIN(tSourceMaskParam.tValidRegion.tSize.iWidth, - tSourceTileParam.tValidRegion.tSize.iWidth); - tSourceMaskParam.tValidRegion.tSize.iHeight = - MIN(tSourceMaskParam.tValidRegion.tSize.iHeight, - tSourceTileParam.tValidRegion.tSize.iHeight); - } - - if (NULL != ptTargetMask) { - tTargetMaskParam.tValidRegion.tSize.iWidth = - MIN(tTargetMaskParam.tValidRegion.tSize.iWidth, - tTargetTileParam.tValidRegion.tSize.iWidth); - tTargetMaskParam.tValidRegion.tSize.iHeight = - MIN(tTargetMaskParam.tValidRegion.tSize.iHeight, - tTargetTileParam.tValidRegion.tSize.iHeight); - } - - /* load virtual resource if any */ - do { - arm_2d_err_t tErr = - __load_virtual_resource(ptSource, &tSourceTileParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - - tErr = __load_virtual_resource(ptSourceMask, &tSourceMaskParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - - tErr = __load_virtual_resource(ptTargetMask, &tTargetMaskParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - } while(0); - - if ( (OP_CORE.ptOp->Info.Param.bHasSrcMask) - || (OP_CORE.ptOp->Info.Param.bHasDesMask)){ - - tResult = __arm_2d_issue_sub_task_fill_with_mask( - ptThis, - &tSourceTileParam, - ((NULL != ptSourceMask) ? &tSourceMaskParam : NULL), - &tTargetTileParam, - ((NULL != ptTargetMask) ? &tTargetMaskParam : NULL) - ); - } else { - tResult = __arm_2d_issue_sub_task_fill( ptThis, - &tSourceTileParam, - &tTargetTileParam); - } - } - } else { //!< normal tile copy operation - - if (OP_CORE.ptOp->Info.Param.bHasOrigin) { - //! handle mirroring - do { - __arm_2d_source_side_tile_mirror_preprocess( - ptOrigin, - &tOriginTileParam, - chOriginPixelLenInBit, - &tActualSize, - wMode); - - if ( OP_CORE.ptOp->Info.Param.bHasSrcMask - && (NULL != ptSourceMask)) { - arm_2d_size_t tMaskActualSize = { - .iWidth = MIN(tActualSize.iWidth, - tSourceMaskParam.tValidRegion.tSize.iWidth), - .iHeight = MIN(tActualSize.iHeight, - tSourceMaskParam.tValidRegion.tSize.iHeight), - }; - __arm_2d_source_side_tile_mirror_preprocess( - ptSourceMask, - &tSourceMaskParam, - chSourceMaskPixelLenInBit, - &tMaskActualSize, - wMode); - } - } while(0); - -// /* trim source valid region */ -// tSourceTileParam.tValidRegion.tSize = tActualSize; - - /* trim source mask valid region */ - if (NULL != ptTargetMask) { - tTargetMaskParam.tValidRegion.tSize.iWidth = - MIN(tTargetMaskParam.tValidRegion.tSize.iWidth, - tTargetTileParam.tValidRegion.tSize.iWidth); - tTargetMaskParam.tValidRegion.tSize.iHeight = - MIN(tTargetMaskParam.tValidRegion.tSize.iHeight, - tTargetTileParam.tValidRegion.tSize.iHeight); - } - - /* load virtual resource if any */ - do { - arm_2d_err_t tErr = - __load_virtual_resource(ptOrigin, &tOriginTileParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - - tErr = __load_virtual_resource(ptSourceMask, &tSourceMaskParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - - tErr = __load_virtual_resource(ptTargetMask, &tTargetMaskParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - } while(0); - - if ( (OP_CORE.ptOp->Info.Param.bHasSrcMask) - || (OP_CORE.ptOp->Info.Param.bHasDesMask)){ - tResult = __arm_2d_issue_sub_task_copy_origin_masks( - ptThis, - &tSourceTileParam, - &tOriginTileParam, - ((NULL != ptSourceMask) ? &tSourceMaskParam : NULL), - &tTargetTileParam, - ((NULL != ptTargetMask) ? &tTargetMaskParam : NULL), - &tActualSize); - } else { - tResult = __arm_2d_issue_sub_task_copy_origin( - ptThis, - &tSourceTileParam, - &tOriginTileParam, - &tTargetTileParam, - &tActualSize); - } - } else { - - - - //! handle mirroring - do { - __arm_2d_source_side_tile_mirror_preprocess( - ptSource, - &tSourceTileParam, - chSourcePixelLenInBit, - &tActualSize, - wMode); - - if ( OP_CORE.ptOp->Info.Param.bHasSrcMask - && (NULL != ptSourceMask)) { - arm_2d_size_t tMaskActualSize = { - .iWidth = MIN(tActualSize.iWidth, - tSourceMaskParam.tValidRegion.tSize.iWidth), - .iHeight = MIN(tActualSize.iHeight, - tSourceMaskParam.tValidRegion.tSize.iHeight), - }; - __arm_2d_source_side_tile_mirror_preprocess( - ptSourceMask, - &tSourceMaskParam, - chSourceMaskPixelLenInBit, - &tMaskActualSize, - wMode); - } - } while(0); - -// /* trim source valid region */ -// tSourceTileParam.tValidRegion.tSize = tActualSize; - - if (NULL != ptSourceMask) { - tSourceMaskParam.tValidRegion.tSize.iWidth = - MIN(tSourceMaskParam.tValidRegion.tSize.iWidth, - tSourceTileParam.tValidRegion.tSize.iWidth); - tSourceMaskParam.tValidRegion.tSize.iHeight = - MIN(tSourceMaskParam.tValidRegion.tSize.iHeight, - tSourceTileParam.tValidRegion.tSize.iHeight); - } - - if (NULL != ptTargetMask) { - tTargetMaskParam.tValidRegion.tSize.iWidth = - MIN(tTargetMaskParam.tValidRegion.tSize.iWidth, - tTargetTileParam.tValidRegion.tSize.iWidth); - tTargetMaskParam.tValidRegion.tSize.iHeight = - MIN(tTargetMaskParam.tValidRegion.tSize.iHeight, - tTargetTileParam.tValidRegion.tSize.iHeight); - } - - /* load virtual resource if any */ - do { - arm_2d_err_t tErr = - __load_virtual_resource(ptSource, &tSourceTileParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - - tErr = __load_virtual_resource(ptSourceMask, &tSourceMaskParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - - tErr = __load_virtual_resource(ptTargetMask, &tTargetMaskParam); - if (tErr != ARM_2D_ERR_NONE) { - return (arm_fsm_rt_t)tErr; - } - } while(0); - - if ( (OP_CORE.ptOp->Info.Param.bHasSrcMask) - || (OP_CORE.ptOp->Info.Param.bHasDesMask)){ - tResult = __arm_2d_issue_sub_task_copy_with_mask( - ptThis, - &tSourceTileParam, - ((NULL != ptSourceMask) ? &tSourceMaskParam : NULL), - &tTargetTileParam, - ((NULL != ptTargetMask) ? &tTargetMaskParam : NULL), - &tActualSize); - } else { - tResult = __arm_2d_issue_sub_task_copy( ptThis, - &tSourceTileParam, - &tTargetTileParam, - &tActualSize); - } - } - } - - return tResult; -} - - -static -arm_fsm_rt_t __tile_clipped_pave( - arm_2d_op_cp_t *ptThis, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - arm_2d_region_t *ptClippedRegion, - uint32_t wMode) -{ - - arm_2d_tile_t tTempSourceTile = {0}; - arm_2d_tile_t tTargetTile = {0}; - - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - do { - arm_2d_region_t tempRegion = { - .tLocation = this.Source.ptTile->tRegion.tLocation, - .tSize = ptRegion->tSize, - }; - - tempRegion.tLocation.iX = -ptRegion->tLocation.iX; - tempRegion.tLocation.iY = -ptRegion->tLocation.iY; - tempRegion.tSize.iWidth += ptRegion->tLocation.iX; - tempRegion.tSize.iHeight += ptRegion->tLocation.iY; - - - if (NULL == arm_2d_tile_generate_child( this.Source.ptTile, - &tempRegion, - &tTempSourceTile, - true)) { - break; - }; - - if (NULL != ptClippedRegion) { - *ptClippedRegion = tTempSourceTile.tRegion; - } - - //! [Modify][Target.ptTile] - //if (NULL == arm_2d_tile_generate_child( this.Target.ptTile, - if (NULL == arm_2d_tile_generate_child( //this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile, - ptTarget, - ptRegion, - &tTargetTile, - true)) { - break; - } - - - #if 0 - switch (OP_CORE.ptOp->Info.Colour.u3ColourSZ) { - case ARM_2D_COLOUR_SZ_8BIT: - case ARM_2D_COLOUR_SZ_16BIT: - case ARM_2D_COLOUR_SZ_32BIT: - tResult = __arm_2d_region_calculator( ptThis, - &tTempSourceTile, - &tTargetTile, - wMode); - break; - default: - tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - break; - } - #else - if (OP_CORE.ptOp->Info.Colour.u3ColourSZ >= ARM_2D_COLOUR_SZ_8BIT) { - tResult = __arm_2d_region_calculator( ptThis, - &tTempSourceTile, - NULL, //!< source mask - &tTargetTile, - NULL, //!< target mask - wMode); - } else { - tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } - #endif - } while(0); - - return tResult; -} - -static arm_fsm_rt_t __tile_non_negtive_location_pave( - arm_2d_op_cp_t *ptThis, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - do { - arm_2d_tile_t tTile = {0}; - if (NULL == arm_2d_tile_generate_child(ptTarget, ptRegion, &tTile, true)) { - break; - } - #if 0 - switch (OP_CORE.ptOp->Info.Colour.u3ColourSZ) { - case ARM_2D_COLOUR_SZ_8BIT: - case ARM_2D_COLOUR_SZ_16BIT: - case ARM_2D_COLOUR_SZ_32BIT: - tResult = __arm_2d_region_calculator(ptThis, ptSource, &tTile, wMode); - break; - default: - tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - break; - } - #else - if (OP_CORE.ptOp->Info.Colour.u3ColourSZ >= ARM_2D_COLOUR_SZ_8BIT) { - tResult = __arm_2d_region_calculator( ptThis, - ptSource, - NULL, //!< source mask - &tTile, - NULL, //!< target mask - wMode); - } else { - tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } - #endif - } while(0); - - return tResult; -} - - -__WEAK -bool __arm_2d_op_ensure_resource( arm_2d_op_core_t *ptOP, - uint_fast16_t hwRequired) -{ - ARM_2D_UNUSED(hwRequired); - ARM_2D_UNUSED(ptOP); - return true; -} - -static -arm_fsm_rt_t __arm_2d_op_frontend_region_process( arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_t, ptOP) - - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION;; - arm_2d_tile_t tTile = {0}; - arm_2d_region_t tDrawRegion = {0}; - arm_2d_region_t tTargetRegion = {0}; - arm_2d_tile_t *ptTarget = NULL; - - if (!__arm_2d_op_ensure_resource(ptOP, 1)) { - //! insufficient resources, ask users to try again - return arm_fsm_rt_wait_for_res; - } - - - if (NULL == this.Target.ptRegion) { - //! use target region instead - this.Target.ptRegion = &(this.Target.ptTile->tRegion); - - tTargetRegion.tSize = (*this.Target.ptRegion).tSize; - } else { - - tTargetRegion = *this.Target.ptRegion; - } - - //! handle the offset of the target tile - do { - //arm_2d_tile_t tValidTargetTile; - arm_2d_region_t tValidRegion; - arm_2d_location_t tOffset; - if (NULL == arm_2d_tile_get_root(this.Target.ptTile, &tValidRegion, &tOffset)) { - //! nothing to draw, actually - return (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - } - - //! calculate the valid region in the view of the target tile - tValidRegion.tLocation = tOffset; - - //! [Modify][Target.ptTile] - //this.Target.ptTile = arm_2d_tile_generate_child( this.Target.ptTile, - //this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile - - ptTarget = arm_2d_tile_generate_child( this.Target.ptTile, - &tValidRegion, - &tTile, - true); - //! [Modify][Target.ptTile] - //assert(NULL != this.Target.ptTile); - //assert(NULL != this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile); - assert(NULL != ptTarget); - tTargetRegion.tLocation.iX -= tOffset.iX; - tTargetRegion.tLocation.iY -= tOffset.iY; - - } while(0); - - //! [Modify][Target.ptTile] - //tDrawRegion.tSize = this.Target.ptTile->tRegion.tSize; - //tDrawRegion.tSize - // = this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile->tRegion.tSize; - tDrawRegion.tSize = ptTarget->tRegion.tSize; - if (!arm_2d_region_intersect( &tDrawRegion, - &tTargetRegion, - &tDrawRegion)) { - return (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - } - - - //! drawing - do { - arm_2d_tile_t tTempTile = {0}; - - //! [Modify][Target.ptTile] - //if (NULL == arm_2d_tile_generate_child( this.Target.ptTile, - if (NULL == arm_2d_tile_generate_child( - //this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile, - ptTarget, - &tTargetRegion, - &tTempTile, true)) { - break; - } - #if 0 - switch (OP_CORE.ptOp->Info.Colour.u3ColourSZ) { - case ARM_2D_COLOUR_SZ_8BIT: - case ARM_2D_COLOUR_SZ_16BIT: - case ARM_2D_COLOUR_SZ_32BIT: - tResult = __arm_2d_region_calculator(ptThis, ptSource, &tTile, wMode); - break; - default: - tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - break; - } - #else - if (OP_CORE.ptOp->Info.Colour.u3ColourSZ >= ARM_2D_COLOUR_SZ_8BIT) { - tResult = __arm_2d_tile_process( ptThis, - &tTempTile); - } else { - tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } - #endif - } while(0); - - return tResult; -} - -static -arm_fsm_rt_t __arm_2d_op_frontend_control( arm_2d_op_core_t *ptOP) -{ - /*TODO: add support for control operations*/ - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; -} - -static -arm_fsm_rt_t __arm_2d_op_frontend_region_process_with_src( arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_src_t, ptOP) - - arm_fsm_rt_t tResult; - arm_2d_tile_t tTile = {0}; - arm_2d_region_t tDrawRegion = {0}; - arm_2d_region_t tTargetRegion = {0}; - const arm_2d_tile_t *ptTarget = NULL; - - if (!__arm_2d_op_ensure_resource(ptOP, 4)) { - //! insufficient resources, ask users to try again - return arm_fsm_rt_wait_for_res; - } - - - if (NULL == this.Target.ptRegion) { - //! use target region instead - this.Target.ptRegion = &(this.Target.ptTile->tRegion); - - tTargetRegion.tSize = (*this.Target.ptRegion).tSize; - } else { - - tTargetRegion = *this.Target.ptRegion; - } - - //! handle the offset of the target tile - do { - //arm_2d_tile_t tValidTargetTile; - - arm_2d_region_t tValidRegion; - arm_2d_location_t tOffset; - if (NULL == arm_2d_tile_get_root(this.Target.ptTile, &tValidRegion, &tOffset)) { - //! nothing to draw, actually - return (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - } - - //! calculate the valid region in the view of the target tile - tValidRegion.tLocation = tOffset; - //if (tOffset.iX != 0 || tOffset.iY != 0) { - //!! [Modify][Target.ptTile] - //this.Target.ptTile = arm_2d_tile_generate_child( this.Target.ptTile, - //this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile - ptTarget = arm_2d_tile_generate_child( this.Target.ptTile, - &tValidRegion, - &tTile, - true); - //!! [Modify][Target.ptTile] - //assert(NULL != this.Target.ptTile); - //assert(NULL != this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile); - assert(NULL != ptTarget); - tTargetRegion.tLocation.iX -= tOffset.iX; - tTargetRegion.tLocation.iY -= tOffset.iY; - //} - - } while(false); - - - - if ( this.wMode & ARM_2D_CP_MODE_FILL) { - /* quickly ignore non visiable area, only for FILL mode */ - if (tTargetRegion.tLocation.iX < 0) { - int_fast16_t iX = tTargetRegion.tLocation.iX; - - tTargetRegion.tLocation.iX %= this.Source.ptTile->tRegion.tSize.iWidth; - - //! calculate the delta - iX = tTargetRegion.tLocation.iX - iX; - - //! update the width to make sure the range won't be expanded mistakenly - tTargetRegion.tSize.iWidth -= iX; - } - - if (tTargetRegion.tLocation.iY < 0) { - int_fast16_t iY = tTargetRegion.tLocation.iY; - tTargetRegion.tLocation.iY %= this.Source.ptTile->tRegion.tSize.iHeight; - - //! calculate the delta - iY = tTargetRegion.tLocation.iY - iY; - - //! update the width to make sure the range won't be expanded mistakenly - tTargetRegion.tSize.iHeight -= iY; - } - } - - //!! [Modify][Target.ptTile] - //tDrawRegion.tSize = this.Target.ptTile->tRegion.tSize; - //tDrawRegion.tSize = this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile->tRegion.tSize; - tDrawRegion.tSize = ptTarget->tRegion.tSize; - if (!arm_2d_region_intersect( &tDrawRegion, - &tTargetRegion, - &tDrawRegion)) { - //! no overlapping - return (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - } - - if ( (tTargetRegion.tLocation.iX < 0) - || (tTargetRegion.tLocation.iY < 0)) { - /*! draw the top left corner */ - /* - HOW IT WORKS: - - source tile (with negative relative location) - +------------------------------------+ - | | - | +------------------------------+-- ... --+ - | |//////////////////////////////| | - | |//ACTUAL DRAWING PART/////////| | - | |//////////////////////////////| | - +-----+------------------------------+-- ... --| - | | | - ... ... ... - | | | - +------------------------------+-- ... --+ - */ - arm_2d_region_t tClippdRegion; - tResult = __tile_clipped_pave( &this, - ptTarget, - &tTargetRegion, - &tClippdRegion, - this.wMode & ~ARM_2D_CP_MODE_FILL); - - if (tResult < 0) { - return tResult; - } - - if (this.wMode & ARM_2D_CP_MODE_FILL) { /*!< fill mode */ - /*! draw the partial header */ - /* - HOW IT WORKS: - - source tile (with negative relative location) - +------------------+------------------------------------+-- ... --+ - | | IGNORED HEADER PART | repeat | - | +---------------+------------------------------------+-- ... --+ - | | |////////////////////////////////////|/////////| - | |Clipped Region |////ACTUAL DRAWING PART/////////////|/repeat//| - | | |////////////////////////////////////|/////////| - +--+---------------+------------------------------------+-- ... --+ - | | - | | - +---------------------------------------------------------- ... --+ - */ - - if (tClippdRegion.tSize.iWidth < tDrawRegion.tSize.iWidth) { - //! something left to draw - - arm_2d_region_t tHeaderRegion = tDrawRegion; - tHeaderRegion.tSize.iWidth = tDrawRegion.tSize.iWidth - - tClippdRegion.tSize.iWidth; - tHeaderRegion.tLocation.iX += tClippdRegion.tSize.iWidth; - tHeaderRegion.tSize.iHeight = tClippdRegion.tSize.iHeight - - tTargetRegion.tLocation.iY; - tHeaderRegion.tLocation.iY = tTargetRegion.tLocation.iY; - - tResult = __tile_clipped_pave( &this, - ptTarget, - &tHeaderRegion, - NULL, - this.wMode); - - //arm_2d_region_t tClippedRegion; - if (tResult < 0) { - return tResult; - } - } - - - - /*! draw the partial column */ - /* - HOW IT WORKS: - - source tile (with negative relative location) - +------------------------------------+ - | | - | +------------------------------+-- ... --+ - | | | | - | | | | - | | | | - +-----+------------------------------+ | - | |//////////////////////////////| | - | |//////////////////////////////| | - | |////ACTUAL DRAWING COLUMN/////| | - | |//////////////////////////////| | - | |//////////////////////////////| | - +-----+------------------------------+ | - | |//////////////////////////////| | - ... ...///repeat////////////////////| | - | |//////////////////////////////| | - +-----+------------------------------+-- ... --+ - */ - - if (tClippdRegion.tSize.iHeight < tDrawRegion.tSize.iHeight) { - //! something left to draw - - arm_2d_region_t tFirstColumnRegion = tDrawRegion; - tFirstColumnRegion.tSize.iHeight = tDrawRegion.tSize.iHeight - tClippdRegion.tSize.iHeight; - tFirstColumnRegion.tLocation.iY += tClippdRegion.tSize.iHeight; - tFirstColumnRegion.tSize.iWidth = tClippdRegion.tSize.iWidth - - tTargetRegion.tLocation.iX; - tFirstColumnRegion.tLocation.iX = tTargetRegion.tLocation.iX; - - tResult = __tile_clipped_pave( &this, - ptTarget, - &tFirstColumnRegion, - NULL, - this.wMode); - - if (tResult < 0) { - return tResult; - } - } - - - /*! draw the normal non-negitive part */ - /* - HOW IT WORKS: - - source tile (with negative relative location) - +------------------------------------+ - | | - | +------------------------------+-- ... --+ - | | | | - | | | | - | | | | - +-----+------------------------------+-- ... --| - | |/////////| - | |/////////| - ... ...///////... - | |/////////| - | |/////////| - +------------------------------+-- ... --+ - */ - - if ( (tClippdRegion.tSize.iWidth < tDrawRegion.tSize.iWidth) - && (tClippdRegion.tSize.iHeight < tDrawRegion.tSize.iHeight)) { - - arm_2d_region_t tNonNegRegion = tDrawRegion; - tNonNegRegion.tSize.iWidth = tDrawRegion.tSize.iWidth - tClippdRegion.tSize.iWidth; - tNonNegRegion.tSize.iHeight = tDrawRegion.tSize.iHeight - tClippdRegion.tSize.iHeight; - tNonNegRegion.tLocation.iX += tClippdRegion.tSize.iWidth; - tNonNegRegion.tLocation.iY += tClippdRegion.tSize.iHeight; - - tResult = __tile_non_negtive_location_pave( &this, - this.Source.ptTile, - - //! [Modify][Target.ptTile] - //this.Target.ptTile, - //this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile, - ptTarget, - &tNonNegRegion, - this.wMode); - if (tResult < 0) { - return tResult; - } - } - } - } else { - tResult = __tile_non_negtive_location_pave( &this, - this.Source.ptTile, - - //! [Modify][Target.ptTile] - //this.Target.ptTile, - //this.use_as__arm_2d_op_core_t.Runtime.ptTargetTile, - ptTarget, - &tTargetRegion, - this.wMode); - } - - return tResult; -} - - -/*----------------------------------------------------------------------------* - * Frontend * - *----------------------------------------------------------------------------*/ - -arm_fsm_rt_t __arm_2d_op_depose(arm_2d_op_core_t *ptThis, - arm_fsm_rt_t tResult) -{ - //arm_irq_safe - { - this.tResult = tResult; - this.Status.tValue = - ((tResult < 0) ? __ARM_2D_OP_STATUS_IO_ERROR_msk : 0) | - __ARM_2D_OP_STATUS_CPL_msk ; - } - return tResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_op_frontend_on_leave( arm_2d_op_core_t *ptThis, - arm_fsm_rt_t tResult) -{ - return __arm_2d_op_depose(ptThis, tResult); -} - -static void __arm_2d_op_use_default_frame_buffer(arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_t, ptOP); - - if ((intptr_t)-1 == (intptr_t)this.Target.ptTile) { - this.Target.ptTile = ARM_2D_CTRL.ptDefaultFrameBuffer; - } -} - - -arm_fsm_rt_t __arm_2d_op_frontend_op_decoder(arm_2d_op_core_t *ptThis) -{ - arm_fsm_rt_t tResult; - - //! decode operation - switch (this.ptOp->Info.Param.chValue & - ( ARM_2D_OP_INFO_PARAM_HAS_SOURCE - //| ARM_2D_OP_INFO_PARAM_HAS_ORIGIN - | ARM_2D_OP_INFO_PARAM_HAS_TARGET - //| ARM_2D_OP_INFO_PARAM_HAS_SOURCE_MASK - //| ARM_2D_OP_INFO_PARAM_HAS_TARGET_MASK - )) { - - case ( ARM_2D_OP_INFO_PARAM_HAS_SOURCE - | ARM_2D_OP_INFO_PARAM_HAS_TARGET): - __arm_2d_op_use_default_frame_buffer(ptThis); - /* operaion process target tile based on source tile */ - tResult = __arm_2d_op_frontend_region_process_with_src(ptThis); - break; - - case ARM_2D_OP_INFO_PARAM_HAS_TARGET: - __arm_2d_op_use_default_frame_buffer(ptThis); - /* operation which only processes target tile */ - tResult = __arm_2d_op_frontend_region_process(ptThis); - break; - - default: - /* control operation */ - tResult = __arm_2d_op_frontend_control(ptThis); - } - - if (ARM_2D_ERR_OUT_OF_REGION == tResult) { - if (ARM_2D_RUNTIME_FEATURE.TREAT_OUT_OF_RANGE_AS_COMPLETE) { - //! nothing to draw - tResult = arm_fsm_rt_cpl; - } - } - - return tResult; -} - - -__WEAK -/*! - * \brief wait asynchronouse operation complete - * \retval true sync up with operation - * \retval false operation is busy - */ -bool arm_2d_op_wait_async(arm_2d_op_core_t *ptOP) -{ - return true; -} - - -__WEAK -/*! \brief sync up with operation - *! \retval true operation is busy - *! \retval false operation isn't busy - */ -bool __arm_2d_op_acquire(arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_core_t, ptOP) - bool bResult = !this.Status.bIsBusy; - - arm_irq_safe { - if (bResult) { - //! initialize operation - do { - this.tResult = arm_fsm_rt_async; - this.Status.tValue = 0; //! reset status - this.Status.bIsBusy = true; //! set busy flag - } while(0); - } - } - - return bResult; -} - -__WEAK -arm_fsm_rt_t __arm_2d_op_frontend(arm_2d_op_core_t *ptThis) -{ - arm_fsm_rt_t tResult; - - tResult = __arm_2d_op_frontend_op_decoder(ptThis); - - return __arm_2d_op_frontend_on_leave(ptThis, tResult); -} - -arm_fsm_rt_t __arm_2d_op_invoke(arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_core_t, ptOP) - -#if 0 - if (this.Status.bIsBusy) { - return arm_fsm_rt_on_going; - } - - //! initialize operation - do { - this.tResult = arm_fsm_rt_async; - this.Status.tValue = 0; //! reset status - this.Status.bIsBusy = true; //! set busy flag - } while(0); -#endif - - return __arm_2d_op_frontend(ptThis); -} - - -/*! - * \brief initialise the arm-2d core service - */ -void __arm_2d_init(void) -{ - /*! initialise arm-2d control block */ - memset(&ARM_2D_CTRL, 0, sizeof(struct __arm_2d_op_control)); -} - -/*! - * \brief set the default frame buffer - * \param ptFrameBuffer the new frame buffer, - * \note Passing NULL means using no default framebuffer - * \return arm_2d_tile_t* the address of the old frame buffer - */ -arm_2d_tile_t *arm_2d_set_default_frame_buffer(const arm_2d_tile_t *ptFrameBuffer) -{ - arm_2d_tile_t *ptOldBuffer = NULL; - - arm_irq_safe { - ptOldBuffer = ARM_2D_CTRL.ptDefaultFrameBuffer; - ARM_2D_CTRL.ptDefaultFrameBuffer = (arm_2d_tile_t *)ptFrameBuffer; - } - - return ptOldBuffer; -} - -/*! - * \brief get the default frame buffer - * \return arm_2d_tile_t* the address of the default frame buffer - */ -arm_2d_tile_t *arm_2d_get_default_frame_buffer(void) -{ - return ARM_2D_CTRL.ptDefaultFrameBuffer; -} - -/*! - * \brief attach a user param (which could be a pointer) to specified OP - * \param ptOP the address of the target OP (NULL means using the default OP) - * \param pUserParam a user parameter (it can be used as a pointer) - */ -void arm_2d_set_user_param(arm_2d_op_core_t *ptOP, uintptr_t pUserParam) -{ - ARM_2D_IMPL(arm_2d_op_core_t, ptOP); - - this.pUserParam = pUserParam; -} - -/*! - \brief get the status of a specified OP, - \param ptOP the address of the target OP (NULL means using the default OP) - \return arm_2d_op_status_t the operation status - */ -/* - usually, it is used after calling arm_2d_op_wait_async(). - E.g. - //! wait for previous operation complete - do { - arm_2d_op_wait_async(); - arm_2d_op_status_t tStatus = arm_2d_get_op_status(); - if (tStatus.bIOError) { - //! error detected - ... - } else if (tStatus.bOpCpl) { - break; - } - } while(true); - */ -arm_2d_op_status_t arm_2d_get_op_status(arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_core_t, ptOP) - - volatile arm_2d_op_status_t *ptStatus - = (volatile arm_2d_op_status_t *)&(this.Status); - - return *ptStatus; -} - - -__WEAK -/*! - * \brief arm-2d pixel pipeline task entery - * \note This function is *TRHEAD-SAFE* - * \param ptTask the address of an arm-2d task control block - * \retval arm_fsm_rt_cpl The sub-task FIFO is empty, the caller can wait for a - * semaphore set by arm_2d_notif_sub_task_fifo_task_arrive() - * \retval arm_fsm_rt_on_going The arm_2d_task yields - * \retval arm_fsm_rt_async You shouldn't see this value - * \retval arm_fsm_rt_wait_for_obj hardware accelerator wants to sync-up with applications. - * \retval (<0) Serious error is detected. - */ -arm_fsm_rt_t arm_2d_task(arm_2d_task_t *ptTask) -{ - ARM_2D_UNUSED(ptTask); - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Utilieis * - *----------------------------------------------------------------------------*/ - -arm_2d_err_t __arm_mask_validate( const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - uint32_t wMode) -{ - ARM_2D_UNUSED(wMode); - - if (NULL != ptSrcMask) { - //! valid source mask tile - if (0 == ptSrcMask->bHasEnforcedColour) { - return ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptSrcMask->tColourInfo.u3ColourSZ) - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - && (ARM_2D_CHANNEL_8in32 != ptSrcMask->tColourInfo.chScheme) - #endif - ) { - return ARM_2D_ERR_INVALID_PARAM; - } - - arm_2d_cmp_t tCompare = arm_2d_tile_shape_compare(ptSrcMask, ptSource); - - /*! \note the source mask tile should be bigger than or equals to the - *! source tile - */ - if (ARM_2D_CMP_SMALLER == tCompare) { - - return ARM_2D_ERR_INVALID_PARAM; - } - } - - if (NULL != ptDesMask) { - //! valid target mask tile - if (0 == ptDesMask->bHasEnforcedColour) { - return ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptDesMask->tColourInfo.u3ColourSZ) - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - && (ARM_2D_CHANNEL_8in32 != ptDesMask->tColourInfo.chScheme) - #endif - ) { - return ARM_2D_ERR_INVALID_PARAM; - } - - /*! \note the target mask tile should be bigger than or equals to the - *! target tile in width - */ - if (ARM_2D_CMP_SMALLER == arm_2d_tile_width_compare(ptDesMask, ptTarget)) { - return ARM_2D_ERR_INVALID_PARAM; - } - - if (ARM_2D_CMP_SMALLER == arm_2d_tile_height_compare(ptDesMask, ptTarget)) { - if (1 != ptDesMask->tRegion.tSize.iHeight) { - return ARM_2D_ERR_INVALID_PARAM; - } else if (ARM_2D_CHANNEL_8in32 == ptDesMask->tColourInfo.chScheme) { - /*! does NOT support a target mask consists of 1 horizontal line - *! in the special colour 'ARM_2D_CHANNEL_8in32'. - */ - return ARM_2D_ERR_INVALID_PARAM; - } - } - - } - - return ARM_2D_ERR_NONE; -} - - -/*----------------------------------------------------------------------------* - * Low Level IO Interfaces * - *----------------------------------------------------------------------------*/ - -const __arm_2d_op_info_t ARM_2D_OP_BARRIER = { - .Info = { - //! control operation - .Param = { - .bHasSource = false, - .bHasTarget = false, - }, - .chOpIndex = __ARM_2D_OP_IDX_BARRIER, - - .LowLevelIO = { - .ptCopyLike = NULL, - .ptFillLike = NULL, - }, - }, -}; - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Source/__arm_2d_draw_pattern.inc b/package/Arm2D/Library/Source/__arm_2d_draw_pattern.inc deleted file mode 100644 index b12defeab..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_draw_pattern.inc +++ /dev/null @@ -1,336 +0,0 @@ - -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_draw_pattern.inc - * Description: c code template for drawing pattern - * - * $Date: 14. April 2020 - * $Revision: V.1.0.0 - * - * -------------------------------------------------------------------- */ - - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_INT_TYPE -# error You have to define the __API_INT_TYPE before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __arm_2d_impl_##__COLOUR##_##__NAME -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - - -__WEAK -void __ARM_2D_FUNC(draw_pattern_fg_only)(uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE ForeColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - uint8_t *__RESTRICT pchSrc = pchSourceBase; - __API_INT_TYPE * __RESTRICT pTarget = pTargetBase; - uint8_t chBitMask = _BV(iOffset); - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - - if ((*pchSrc) & chBitMask) { - *pTarget = ForeColour; - } - - pTarget++; - chBitMask <<= 1; - if (!chBitMask) { - chBitMask = 1; - pchSrc++; - } - } - //chBitMask = 1; - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -} - -__WEAK -void __ARM_2D_FUNC(draw_pattern_no_bg_comp)( - uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - uint8_t *__RESTRICT pchSrc = pchSourceBase; - __API_INT_TYPE * __RESTRICT pTarget = pTargetBase; - uint8_t chBitMask = _BV(iOffset); - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - - if ((*pchSrc) & chBitMask) { - *pTarget = ~(*pTarget); - } - - pTarget++; - chBitMask <<= 1; - if (!chBitMask) { - chBitMask = 1; - pchSrc++; - } - } - chBitMask = 1; - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -} - -__WEAK -void __ARM_2D_FUNC(draw_pattern_bg_only)( uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE BackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - uint8_t *__RESTRICT pchSrc = pchSourceBase; - __API_INT_TYPE * __RESTRICT pTarget = pTargetBase; - uint8_t chBitMask = _BV(iOffset); - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - - if (!((*pchSrc) & chBitMask)) { - *pTarget = BackColour; - } - - pTarget++; - chBitMask <<= 1; - if (!chBitMask) { - chBitMask = 1; - pchSrc++; - } - } - chBitMask = 1; - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -} - - -__WEAK -void __ARM_2D_FUNC(draw_pattern_bg_fg)( uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE ForeColour, - __API_INT_TYPE BackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - uint8_t *__RESTRICT pchSrc = pchSourceBase; - __API_INT_TYPE * __RESTRICT pTarget = pTargetBase; - uint8_t chBitMask = _BV(iOffset); - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - - if ((*pchSrc) & chBitMask) { - *pTarget++ = ForeColour; - } else { - *pTarget++ = BackColour; - } - - chBitMask <<= 1; - if (!chBitMask) { - chBitMask = 1; - pchSrc++; - } - } - chBitMask = 1; - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -} - -__WEAK -void __ARM_2D_FUNC(draw_pattern_bg_comp)( uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE BackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - uint8_t *__RESTRICT pchSrc = pchSourceBase; - __API_INT_TYPE * __RESTRICT pTarget = pTargetBase; - uint8_t chBitMask = _BV(iOffset); - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - - if ((*pchSrc) & chBitMask) { - *pTarget = ~(*pTarget); - } else { - *pTarget = BackColour; - } - - pTarget++; - chBitMask <<= 1; - if (!chBitMask) { - chBitMask = 1; - pchSrc++; - } - } - chBitMask = 1; - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -} - - -__WEAK -void __ARM_2D_FUNC(draw_pattern)( uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint8_t chMode, - __API_INT_TYPE ForeColour, - __API_INT_TYPE BackColour) -{ - - switch (chMode & (ARM_2D_DRW_PATN_MODE_NO_FG_COLOR | - ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR | - ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR)) { - - case 0: - //! foreground only - __ARM_2D_FUNC(draw_pattern_fg_only)(pchSourceBase, - iOffset, - iSourceStride, - pTargetBase, - iTargetStride, - ptCopySize, - ForeColour); - break; - - case ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR: - //! background + foreground - __ARM_2D_FUNC(draw_pattern_bg_fg)( pchSourceBase, - iOffset, - iSourceStride, - pTargetBase, - iTargetStride, - ptCopySize, - ForeColour, - BackColour); - - break; - - case ARM_2D_DRW_PATN_MODE_NO_FG_COLOR: - //! no foreground, no background, nothing to do - break; - - case ARM_2D_DRW_PATN_MODE_NO_FG_COLOR | - ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR : - //! background only - __ARM_2D_FUNC(draw_pattern_bg_only)(pchSourceBase, - iOffset, - iSourceStride, - pTargetBase, - iTargetStride, - ptCopySize, - BackColour); - break; - - case ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR: - case ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR | - ARM_2D_DRW_PATN_MODE_NO_FG_COLOR : - //! no background, use complement colour as foreground - __ARM_2D_FUNC(draw_pattern_no_bg_comp)( pchSourceBase, - iOffset, - iSourceStride, - pTargetBase, - iTargetStride, - ptCopySize); - break; - - case ARM_2D_DRW_PATN_MODE_NO_FG_COLOR | - ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR | - ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR : - //! background, use complement colour as foreground - __ARM_2D_FUNC(draw_pattern_bg_comp)(pchSourceBase, - iOffset, - iSourceStride, - pTargetBase, - iTargetStride, - ptCopySize, - BackColour); - - break; - - } -} - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_INT_TYPE diff --git a/package/Arm2D/Library/Source/__arm_2d_draw_pattern_helium.inc b/package/Arm2D/Library/Source/__arm_2d_draw_pattern_helium.inc deleted file mode 100644 index 84e644c2c..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_draw_pattern_helium.inc +++ /dev/null @@ -1,1026 +0,0 @@ - -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_draw_pattern_helium.inc - * Description: Helium code template for drawing pattern - * - * $Date: 12. July 2022 - * $Revision: V.1.0.0 - * - * -------------------------------------------------------------------- */ - - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_ELT_SZ -# error You have to define the __API_ELT_SZ before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) \ - __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__NAME) -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - - - -#if __API_ELT_SZ != 32 - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(draw_pattern_fg_only)(uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - ARM_PIX_SCLTYP(__API_ELT_SZ) *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - ARM_PIX_SCLTYP(__API_ELT_SZ) ForeColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - ARM_PIX_VECTYP(__API_ELT_SZ) offS = - vld1q(ARM_CONNECT2(__draw_pattern_src_incr_, __API_COLOUR) + iOffset); - /* deduces bitmask vector with wrap from iOffset */ - ARM_PIX_VECTYP(__API_ELT_SZ) vBitMask = - vld1q(ARM_CONNECT2(__draw_pattern_src_bitmask_, __API_COLOUR) + iOffset); - - - if (ptCopySize->iWidth <= ARM_PIX_VECELT(__API_ELT_SZ)) { - /* small width specialization */ - /* no inner loop */ - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(ptCopySize->iWidth); - -#ifdef USE_MVE_INTRINSICS - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = vldrbq_gather_offset(pchSourceBase, offS); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q(pTargetBase); - - vchSrc = vchSrc & vBitMask; - vTarg = vdupq_m(vTarg, ForeColour, vcmpneq(vchSrc, 0)); - vst1q_p(pTargetBase, vTarg, p); - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -#else - ARM_PIX_VECTYP(__API_ELT_SZ) vForeG = ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(ForeColour); - - __asm volatile( - ".p2align 2 \n" - " wls lr, %[iHeight], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - " vand q0, q0, %[bitmask] \n" - - " vcmp.i" ARM_TO_STRING(__API_ELT_SZ) \ - " eq, q0, zr \n" - /* contigous vector load */ - ARM_VLD1_ASM(__API_ELT_SZ) \ - " q0, [%[target]] \n" - " vpsel q0, q0,%[ForeG] \n" - " vmsr P0, %[p] \n" - " vpst \n" - /* predicated contigous vector store */ - ARM_VST1P_ASM(__API_ELT_SZ) \ - " q0,[%[target]] \n" - - " add %[src], %[src], %[srcStride] \n" - " add %[target], %[target], %[targStride] \n" - - " le lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBase), [target] "+r" (pTargetBase) - : [bitmask] "t" (vBitMask),[ForeG] "t"(vForeG), - [srcStride] "r" (iSourceStride >> 3), - [targStride] "r" (iTargetStride * (__API_ELT_SZ/8)), - [iHeight] "r" (ptCopySize->iHeight), - [offS] "t" (offS), [p] "r" (p) - : "q0", "memory", "lr"); -#endif - } else { - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - int32_t cnt = ptCopySize->iWidth; - uint8_t *pchSourceBaseCur = pchSourceBase; - ARM_PIX_SCLTYP(__API_ELT_SZ) *pTargetBaseCur = pTargetBase; - -#ifdef USE_MVE_INTRINSICS - while (cnt > 0) { - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(cnt); - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = - vldrbq_gather_offset_z(pchSourceBaseCur, offS, p); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q_z(pTargetBaseCur, p); - - vchSrc = vandq_x(vchSrc, vBitMask, p); - vTarg = vdupq_m(vTarg, ForeColour, vcmpneq_m(vchSrc, 0, p)); - - vst1q_p(pTargetBaseCur, vTarg, p); - - pTargetBaseCur += ARM_PIX_VECELT(__API_ELT_SZ); - pchSourceBaseCur += ARM_PIX_VECELT(__API_ELT_SZ) / 8; - cnt -= ARM_PIX_VECELT(__API_ELT_SZ); - } -#else - ARM_PIX_VECTYP(__API_ELT_SZ) vForeG = ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(ForeColour); - - __asm volatile( - ".p2align 2 \n" - " wlstp."ARM_TO_STRING(__API_ELT_SZ) " lr, %[cnt], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - - " vand q0, q0, %[bitmask] \n" - " add %[src], %[src], %[incrSrc] \n" - - " vpt.i" ARM_TO_STRING(__API_ELT_SZ) \ - " ne, q0, zr \n" - - /* predicated contigous vector store */ - ARM_VST1P_ASM(__API_ELT_SZ) \ - " %[ForeG],[%[target]], #16 \n" - - " letp lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBaseCur), [target] "+r" (pTargetBaseCur) - : [bitmask] "t" (vBitMask),[ForeG] "t"(vForeG), - [cnt] "r" (cnt), [incrSrc] "i" (ARM_PIX_VECELT(__API_ELT_SZ) / 8), - [offS] "t" (offS) - : "q0", "memory", "lr"); -#endif - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } - } -} - - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(draw_pattern_no_bg_comp)( - uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - ARM_PIX_SCLTYP(__API_ELT_SZ) *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - ARM_PIX_VECTYP(__API_ELT_SZ) offS = - vld1q(ARM_CONNECT2(__draw_pattern_src_incr_, __API_COLOUR) + iOffset); - /* deduces bitmask vector with wrap from iOffset */ - ARM_PIX_VECTYP(__API_ELT_SZ) vBitMask = - vld1q(ARM_CONNECT2(__draw_pattern_src_bitmask_, __API_COLOUR) + iOffset); - - if (ptCopySize->iWidth <= ARM_PIX_VECELT(__API_ELT_SZ)) { - /* small width specialization */ - /* no inner loop */ - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(ptCopySize->iWidth); - -#ifdef USE_MVE_INTRINSICS - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = vldrbq_gather_offset(pchSourceBase, offS); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q(pTargetBase); - - vchSrc = vchSrc & vBitMask; - vTarg = vpselq(~vTarg, vTarg, vcmpneq(vchSrc, 0)); - - vst1q_p(pTargetBase, vTarg, p); - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -#else - - __asm volatile( - ".p2align 2 \n" - " wls lr, %[iHeight], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - " vand q0, q0, %[bitmask] \n" - - ARM_VLD1_ASM(__API_ELT_SZ) \ - " q1, [%[target]] \n" - - " vpt.i" ARM_TO_STRING(__API_ELT_SZ) \ - " ne, q0, zr \n" - " vmvnt q1, q1 \n" - - " vmsr P0, %[p] \n" - " vpst \n" - /* predicated contigous vector store */ - ARM_VST1P_ASM(__API_ELT_SZ) \ - " q1,[%[target]] \n" - - " add %[src], %[src], %[srcStride] \n" - " add %[target], %[target], %[targStride] \n" - - " le lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBase), [target] "+r" (pTargetBase) - : [bitmask] "t" (vBitMask), - [srcStride] "r" (iSourceStride >> 3), - [targStride] "r" (iTargetStride*(__API_ELT_SZ/8)), - [iHeight] "r" (ptCopySize->iHeight), - [offS] "t" (offS), [p] "r" (p) - : "q0", "q1", "memory", "lr"); -#endif - - - } else { - - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - int32_t cnt = ptCopySize->iWidth; - uint8_t *pchSourceBaseCur = pchSourceBase; - ARM_PIX_SCLTYP(__API_ELT_SZ) *pTargetBaseCur = pTargetBase; - -#ifdef USE_MVE_INTRINSICS - while (cnt > 0) { - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(cnt); - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = - vldrbq_gather_offset_z(pchSourceBaseCur, offS, p); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q_z(pTargetBaseCur, p); - - vchSrc = vandq_x(vchSrc, vBitMask, p); - vTarg = vpselq(vmvnq_x(vTarg, p), vTarg, vcmpneq_m(vchSrc, 0, p)); - - vst1q_p(pTargetBaseCur, vTarg, p); - - pTargetBaseCur += ARM_PIX_VECELT(__API_ELT_SZ); - pchSourceBaseCur += ARM_PIX_VECELT(__API_ELT_SZ) / 8; - cnt -= ARM_PIX_VECELT(__API_ELT_SZ); - } -#else - - __asm volatile( - ".p2align 2 \n" - " wlstp."ARM_TO_STRING(__API_ELT_SZ) \ - " lr, %[cnt], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - - " vand q0, q0, %[bitmask] \n" - " add %[src], %[src], %[incrSrc] \n" - - ARM_VLD1_ASM(__API_ELT_SZ) \ - " q1, [%[target]] \n" - - " vpt.i" ARM_TO_STRING(__API_ELT_SZ) \ - " ne, q0, zr \n" - " vmvnt q1, q1 \n" - /* contigous vector store */ - ARM_VST1_ASM(__API_ELT_SZ) \ - " q1 ,[%[target]], #16 \n" - - " letp lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBaseCur), [target] "+r" (pTargetBaseCur) - : [bitmask] "t" (vBitMask), - [cnt] "r" (cnt), [incrSrc] "i" (ARM_PIX_VECELT(__API_ELT_SZ) / 8), - [offS] "t" (offS) - : "q0", "q1", "memory", "lr"); -#endif - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } - } -} - - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(draw_pattern_bg_only)( uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - ARM_PIX_SCLTYP(__API_ELT_SZ) *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - ARM_PIX_SCLTYP(__API_ELT_SZ) BackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - ARM_PIX_VECTYP(__API_ELT_SZ) offS = - vld1q(ARM_CONNECT2(__draw_pattern_src_incr_, __API_COLOUR) + iOffset); - /* deduces bitmask vector with wrap from iOffset */ - ARM_PIX_VECTYP(__API_ELT_SZ) vBitMask = - vld1q(ARM_CONNECT2(__draw_pattern_src_bitmask_, __API_COLOUR) + iOffset); - - if (ptCopySize->iWidth <= ARM_PIX_VECELT(__API_ELT_SZ)) { - /* small width specialization */ - /* no inner loop */ - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(ptCopySize->iWidth); - -#ifdef USE_MVE_INTRINSICS - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = vldrbq_gather_offset(pchSourceBase, offS); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q(pTargetBase); - - vchSrc = vchSrc & vBitMask; - vTarg = vdupq_m(vTarg, BackColour, vcmpeqq(vchSrc, 0)); - - vst1q_p(pTargetBase, vTarg, p); - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -#else - ARM_PIX_VECTYP(__API_ELT_SZ) vBackG = ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(BackColour); - - __asm volatile( - ".p2align 2 \n" - " wls lr, %[iHeight], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - " vand q0, q0, %[bitmask] \n" - - " vcmp.i" ARM_TO_STRING(__API_ELT_SZ) \ - " eq, q0, zr \n" - /* contigous vector load */ - ARM_VLD1_ASM(__API_ELT_SZ) \ - " q0, [%[target]] \n" - " vpsel q0, q0,%[vBackG] \n" - " vmsr P0, %[p] \n" - " vpst \n" - /* predicated contigous vector store */ - ARM_VST1P_ASM(__API_ELT_SZ) \ - " q0,[%[target]] \n" - - " add %[src], %[src], %[srcStride] \n" - " add %[target], %[target], %[targStride] \n" - - " le lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBase), [target] "+r" (pTargetBase) - : [bitmask] "t" (vBitMask),[vBackG] "t"(vBackG), - [srcStride] "r" (iSourceStride >> 3), - [targStride] "r" (iTargetStride*(__API_ELT_SZ/8)), - [iHeight] "r" (ptCopySize->iHeight), - [offS] "t" (offS), [p] "r" (p) - : "q0", "memory", "lr"); -#endif - - - } else { - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - int32_t cnt = ptCopySize->iWidth; - uint8_t *pchSourceBaseCur = pchSourceBase; - ARM_PIX_SCLTYP(__API_ELT_SZ) *pTargetBaseCur = pTargetBase; - -#ifdef USE_MVE_INTRINSICS - while (cnt > 0) { - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(cnt); - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = - vldrbq_gather_offset_z(pchSourceBaseCur, offS, p); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q_z(pTargetBaseCur, p); - - vchSrc = vandq_x(vchSrc, vBitMask, p); - vTarg = vdupq_m(vTarg, BackColour, vcmpeqq_m(vchSrc, 0, p)); - - vst1q_p(pTargetBaseCur, vTarg, p); - - pTargetBaseCur += ARM_PIX_VECELT(__API_ELT_SZ); - pchSourceBaseCur += ARM_PIX_VECELT(__API_ELT_SZ) / 8; - cnt -= ARM_PIX_VECELT(__API_ELT_SZ); - } -#else - ARM_PIX_VECTYP(__API_ELT_SZ) vBackG = ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(BackColour); - - __asm volatile( - ".p2align 2 \n" - " wlstp."ARM_TO_STRING(__API_ELT_SZ) " lr, %[cnt], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - - " vand q0, q0, %[bitmask] \n" - " add %[src], %[src], %[incrSrc] \n" - - " vpt.i" ARM_TO_STRING(__API_ELT_SZ) \ - " ne, q0, zr \n" - - /* predicated contigous vector store */ - ARM_VST1P_ASM(__API_ELT_SZ) \ - " %[vBackG],[%[target]], #16 \n" - - " letp lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBaseCur), [target] "+r" (pTargetBaseCur) - : [bitmask] "t" (vBitMask),[vBackG] "t"(vBackG), - [cnt] "r" (cnt), [incrSrc] "i" (ARM_PIX_VECELT(__API_ELT_SZ) / 8), - [offS] "t" (offS) - : "q0", "memory", "lr"); -#endif - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } - } -} - - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(draw_pattern_bg_fg)( uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - ARM_PIX_SCLTYP(__API_ELT_SZ) *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - ARM_PIX_SCLTYP(__API_ELT_SZ) ForeColour, - ARM_PIX_SCLTYP(__API_ELT_SZ) BackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - ARM_PIX_VECTYP(__API_ELT_SZ) offS = - vld1q(ARM_CONNECT2(__draw_pattern_src_incr_, __API_COLOUR) + iOffset); - /* deduces bitmask vector with wrap from iOffset */ - ARM_PIX_VECTYP(__API_ELT_SZ) vBitMask = - vld1q(ARM_CONNECT2(__draw_pattern_src_bitmask_, __API_COLOUR) + iOffset); - ARM_PIX_VECTYP(__API_ELT_SZ) vFgColor = - ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(ForeColour); - ARM_PIX_VECTYP(__API_ELT_SZ) vBgColor = - ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(BackColour); - - if (ptCopySize->iWidth <= ARM_PIX_VECELT(__API_ELT_SZ)) { - /* small width specialization */ - /* no inner loop */ - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(ptCopySize->iWidth); - -#ifdef USE_MVE_INTRINSICS - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = vldrbq_gather_offset(pchSourceBase, offS); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg; - - vchSrc = vchSrc & vBitMask; - vTarg = - vpselq(vFgColor, vBgColor, vcmpneq(vchSrc, 0)); - - vst1q_p(pTargetBase, vTarg, p); - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -#else - - __asm volatile( - ".p2align 2 \n" - " wls lr, %[iHeight], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - " vand q0, q0, %[bitmask] \n" - - " vcmp.i" ARM_TO_STRING(__API_ELT_SZ) \ - " eq, q0, zr \n" - " vpsel q0, %[vBackG], %[vForeG] \n" - " vmsr P0, %[p] \n" - " vpst \n" - /* predicated contigous vector store */ - ARM_VST1P_ASM(__API_ELT_SZ) \ - " q0,[%[target]] \n" - - " add %[src], %[src], %[srcStride] \n" - " add %[target], %[target], %[targStride] \n" - - " le lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBase), [target] "+r" (pTargetBase) - : [bitmask] "t" (vBitMask),[vBackG] "t"(vBgColor), - [vForeG] "t" (vFgColor), - [srcStride] "r" (iSourceStride >> 3), - [targStride] "r" (iTargetStride*(__API_ELT_SZ/8)), - [iHeight] "r" (ptCopySize->iHeight), - [offS] "t" (offS), [p] "r" (p) - : "q0", "memory", "lr"); -#endif - - - } else { - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - int32_t cnt = ptCopySize->iWidth; - uint8_t *pchSourceBaseCur = pchSourceBase; - ARM_PIX_SCLTYP(__API_ELT_SZ) *pTargetBaseCur = pTargetBase; - -#ifdef USE_MVE_INTRINSICS - while (cnt > 0) { - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(cnt); - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = - vldrbq_gather_offset_z(pchSourceBaseCur, offS, p); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg; - - vchSrc = vandq_x(vchSrc, vBitMask, p); - vTarg = - vpselq(vFgColor, vBgColor, vcmpneq_m(vchSrc, 0, p)); - - vst1q_p(pTargetBaseCur, vTarg, p); - - pTargetBaseCur += ARM_PIX_VECELT(__API_ELT_SZ); - pchSourceBaseCur += ARM_PIX_VECELT(__API_ELT_SZ) / 8; - cnt -= ARM_PIX_VECELT(__API_ELT_SZ); - } -#else - __asm volatile( - ".p2align 2 \n" - " wlstp."ARM_TO_STRING(__API_ELT_SZ) " lr, %[cnt], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - - " vand q0, q0, %[bitmask] \n" - " add %[src], %[src], %[incrSrc] \n" - - " vcmp.i" ARM_TO_STRING(__API_ELT_SZ) \ - " eq, q0, zr \n" - " vpsel q0, %[vBackG], %[vForeG] \n" - - ARM_VST1_ASM(__API_ELT_SZ) \ - " q0, [%[target]], #16 \n" - - " letp lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBaseCur), [target] "+r" (pTargetBaseCur) - : [bitmask] "t" (vBitMask),[vBackG] "t"(vBgColor), - [vForeG] "t" (vFgColor), - [cnt] "r" (cnt), [incrSrc] "i" (ARM_PIX_VECELT(__API_ELT_SZ) / 8), - [offS] "t" (offS) - : "q0", "memory", "lr"); -#endif - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } - } -} - - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(draw_pattern_bg_comp)( uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - ARM_PIX_SCLTYP(__API_ELT_SZ) *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - ARM_PIX_SCLTYP(__API_ELT_SZ) BackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - ARM_PIX_VECTYP(__API_ELT_SZ) offS = - vld1q(ARM_CONNECT2(__draw_pattern_src_incr_, __API_COLOUR) + iOffset); - /* deduces bitmask vector with wrap from iOffset */ - ARM_PIX_VECTYP(__API_ELT_SZ) vBitMask = - vld1q(ARM_CONNECT2(__draw_pattern_src_bitmask_, __API_COLOUR) + iOffset); - ARM_PIX_VECTYP(__API_ELT_SZ) vBgColor = - ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(BackColour); - - if (ptCopySize->iWidth <= ARM_PIX_VECELT(__API_ELT_SZ)) { - /* small width specialization */ - /* no inner loop */ - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(ptCopySize->iWidth); - -#ifdef USE_MVE_INTRINSICS - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = vldrbq_gather_offset(pchSourceBase, offS); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q(pTargetBase); - - vchSrc = vchSrc & vBitMask; - vTarg = vpselq(vmvnq(vTarg), vBgColor, vcmpneq(vchSrc, 0)); - - vst1q_p(pTargetBase, vTarg, p); - - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } -#else - __asm volatile( - ".p2align 2 \n" - " wls lr, %[iHeight], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - " vand q0, q0, %[bitmask] \n" - - ARM_VLD1_ASM(__API_ELT_SZ) \ - " q1, [%[target]] \n" - - " vmvn q1, q1 \n" - - " vcmp.i" ARM_TO_STRING(__API_ELT_SZ) \ - " eq, q0, zr \n" - " vpsel q1, %[vBackG], q1 \n" - - " vmsr P0, %[p] \n" - " vpst \n" - /* predicated contigous vector store */ - ARM_VST1P_ASM(__API_ELT_SZ) \ - " q1,[%[target]] \n" - - " add %[src], %[src], %[srcStride] \n" - " add %[target], %[target], %[targStride] \n" - - " le lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBase), [target] "+r" (pTargetBase) - : [bitmask] "t" (vBitMask), [vBackG] "t" (vBgColor), - [srcStride] "r" (iSourceStride >> 3), - [targStride] "r" (iTargetStride*(__API_ELT_SZ/8)), - [iHeight] "r" (ptCopySize->iHeight), - [offS] "t" (offS), [p] "r" (p) - : "q0", "q1", "memory", "lr"); -#endif - } else { - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - int32_t cnt = ptCopySize->iWidth; - uint8_t *pchSourceBaseCur = pchSourceBase; - ARM_PIX_SCLTYP(__API_ELT_SZ) *pTargetBaseCur = pTargetBase; - -#ifdef USE_MVE_INTRINSICS - while (cnt > 0) { - mve_pred16_t p = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(cnt); - ARM_PIX_VECTYP(__API_ELT_SZ) vchSrc = - vldrbq_gather_offset_z(pchSourceBaseCur, offS, p); - ARM_PIX_VECTYP(__API_ELT_SZ) vTarg = vld1q_z(pTargetBaseCur, p); - - vchSrc = vandq_x(vchSrc, vBitMask, p); - vTarg = - vpselq(vmvnq_x(vTarg, p), vBgColor, vcmpneq_m(vchSrc, 0, p)); - - vst1q_p(pTargetBaseCur, vTarg, p); - - pTargetBaseCur += ARM_PIX_VECELT(__API_ELT_SZ); - pchSourceBaseCur += ARM_PIX_VECELT(__API_ELT_SZ) / 8; - cnt -= ARM_PIX_VECELT(__API_ELT_SZ); - } -#else - __asm volatile( - ".p2align 2 \n" - " wlstp."ARM_TO_STRING(__API_ELT_SZ) " lr, %[cnt], 1f \n" - "2: \n" - /* widened vector load */ - ARM_VLDWID_ASM(8,__API_ELT_SZ) \ - " q0, [%[src], %[offS]] \n" - - " vand q0, q0, %[bitmask] \n" - " add %[src], %[src], %[incrSrc] \n" - - ARM_VLD1_ASM(__API_ELT_SZ) \ - " q1, [%[target]] \n" - - " vmvn q1, q1 \n" - - " vcmp.i" ARM_TO_STRING(__API_ELT_SZ) \ - " eq, q0, zr \n" - " vpsel q1, %[vBackG], q1 \n" - - ARM_VST1_ASM(__API_ELT_SZ) \ - " q1, [%[target]], #16 \n" - - " letp lr, 2b \n" - "1: \n" - - : [src] "+l"(pchSourceBaseCur), [target] "+r" (pTargetBaseCur) - : [bitmask] "t" (vBitMask), [vBackG] "t" (vBgColor), - [cnt] "r" (cnt), [incrSrc] "i" (ARM_PIX_VECELT(__API_ELT_SZ) / 8), - [offS] "t" (offS) - : "q0", "q1", "memory", "lr"); -#endif - pchSourceBase += (iSourceStride >> 3); - pTargetBase += iTargetStride; - } - } -} - -#else /* __API_ELT_SZ != 32 */ - -#define GENERIC_RGB32_DRAW_PATTERN(SELECTOR) \ - if (ptCopySize->iWidth <= 4) { \ - /* very tall width case */ \ - /* only bottom parts of gather load and bitmask needed */ \ - /* no inner loop */ \ - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { \ - mve_pred16_t p = vctp32q(ptCopySize->iWidth); \ - uint32x4_t vchSrc = vldrbq_gather_offset_u32(pchSourceBase, offSLo); \ - uint32x4_t vTarg = vld1q(pTargetBase); \ - \ - vchSrc = vandq(vchSrc, vBitMaskLo); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q_p(pTargetBase, vTarg, p); \ - \ - pchSourceBase += (iSourceStride >> 3); \ - pTargetBase += iTargetStride; \ - } \ - } else if (ptCopySize->iWidth <= 8) { \ - /* bottom and partial upper parts of gather load and bitmask needed */ \ - /* no inner loop */ \ - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { \ - mve_pred16_t p = vctp32q(ptCopySize->iWidth - 4); \ - uint32x4_t vchSrc = vldrbq_gather_offset_u32(pchSourceBase, offSLo); \ - uint32x4_t vTarg = vld1q(pTargetBase); \ - \ - vchSrc = vandq(vchSrc, vBitMaskLo); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q(pTargetBase, vTarg); \ - \ - vchSrc = vldrbq_gather_offset_u32(pchSourceBase, offSHi); \ - vTarg = vld1q(pTargetBase + 4); \ - \ - vchSrc = vandq(vchSrc, vBitMaskHi); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q_p(pTargetBase + 4, vTarg, p); \ - \ - pchSourceBase += (iSourceStride >> 3); \ - pTargetBase += iTargetStride; \ - } \ - } else { \ - /* generic case */ \ - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { \ - int32_t cnt = ptCopySize->iWidth; \ - uint8_t *pchSourceBaseCur = pchSourceBase; \ - uint32_t *pTargetBaseCur = pTargetBase; \ - \ - while (cnt >= 8) { \ - uint32x4_t vchSrc = \ - vldrbq_gather_offset_u32(pchSourceBaseCur, offSLo); \ - uint32x4_t vTarg = vld1q(pTargetBaseCur); \ - \ - vchSrc = vandq(vchSrc, vBitMaskLo); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q(pTargetBaseCur, vTarg); \ - pTargetBaseCur += 4; \ - \ - vchSrc = vldrbq_gather_offset_u32(pchSourceBaseCur, offSHi); \ - vTarg = vld1q(pTargetBaseCur); \ - \ - vchSrc = vandq(vchSrc, vBitMaskHi); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q(pTargetBaseCur, vTarg); \ - pTargetBaseCur += 4; \ - \ - pchSourceBaseCur += 1; \ - cnt -= 8; \ - } \ - \ - /* tail */ \ - if (cnt > 4) { \ - /* bottom part + upper residual parts */ \ - uint32x4_t vchSrc = \ - vldrbq_gather_offset_u32(pchSourceBaseCur, offSLo); \ - uint32x4_t vTarg = vld1q(pTargetBaseCur); \ - cnt -= 4; \ - mve_pred16_t p = vctp32q(cnt); \ - \ - vchSrc = vandq(vchSrc, vBitMaskLo); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q(pTargetBaseCur, vTarg); \ - pTargetBaseCur += 4; \ - \ - vchSrc = vldrbq_gather_offset_u32(pchSourceBaseCur, offSHi); \ - vTarg = vld1q(pTargetBaseCur); \ - \ - vchSrc = vandq(vchSrc, vBitMaskHi); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q_p(pTargetBaseCur, vTarg, p); \ - } else if (cnt > 0) { \ - /* bottom part residual */ \ - uint32x4_t vchSrc = \ - vldrbq_gather_offset_u32(pchSourceBaseCur, offSLo); \ - uint32x4_t vTarg = vld1q(pTargetBaseCur); \ - mve_pred16_t p = vctp32q(cnt); \ - \ - vchSrc = vandq(vchSrc, vBitMaskLo); \ - vTarg = SELECTOR(vcmpneq_n_u32(vchSrc, 0)); \ - \ - vst1q_p(pTargetBaseCur, vTarg, p); \ - } \ - \ - pchSourceBase += (iSourceStride >> 3); \ - pTargetBase += iTargetStride; \ - } \ - } - -__OVERRIDE_WEAK -void __arm_2d_impl_rgb32_draw_pattern_fg_only(uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint32_t hwForeColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t offSLo = vld1q(__draw_pattern_src_incr_rgb32 + iOffset); - uint32x4_t offSHi = vld1q(__draw_pattern_src_incr_rgb32 + iOffset + 4); - /* deduces bitmask vector with wrap from iOffset */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t vBitMaskLo = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset); - uint32x4_t vBitMaskHi = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset + 4); - -#define SEL_FG_ONLY(p) vdupq_m_n_u32(vTarg, hwForeColour, p); - - GENERIC_RGB32_DRAW_PATTERN(SEL_FG_ONLY); -} - - - -__OVERRIDE_WEAK -void __arm_2d_impl_rgb32_draw_pattern_no_bg_comp(uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t offSLo = vld1q(__draw_pattern_src_incr_rgb32 + iOffset); - uint32x4_t offSHi = vld1q(__draw_pattern_src_incr_rgb32 + iOffset + 4); - /* deduces bitmask vector with wrap from iOffset */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t vBitMaskLo = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset); - uint32x4_t vBitMaskHi = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset + 4); - -#define SEL_NO_BG_COMP(p) vpselq(~vTarg, vTarg, p); - - GENERIC_RGB32_DRAW_PATTERN(SEL_NO_BG_COMP); - -} - - - - - -__OVERRIDE_WEAK -void __arm_2d_impl_rgb32_draw_pattern_bg_only(uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint32_t hwBackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t offSLo = vld1q(__draw_pattern_src_incr_rgb32 + iOffset); - uint32x4_t offSHi = vld1q(__draw_pattern_src_incr_rgb32 + iOffset + 4); - /* deduces bitmask vector with wrap from iOffset */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t vBitMaskLo = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset); - uint32x4_t vBitMaskHi = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset + 4); - -#define SEL_BG_ONLY(p) vdupq_m_n_u32(vTarg, hwBackColour, p); - - GENERIC_RGB32_DRAW_PATTERN(SEL_BG_ONLY); - -} - - - - -__OVERRIDE_WEAK -void __arm_2d_impl_rgb32_draw_pattern_bg_fg(uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint32_t hwForeColour, - uint32_t hwBackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t offSLo = vld1q(__draw_pattern_src_incr_rgb32 + iOffset); - uint32x4_t offSHi = vld1q(__draw_pattern_src_incr_rgb32 + iOffset + 4); - /* deduces bitmask vector with wrap from iOffset */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t vBitMaskLo = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset); - uint32x4_t vBitMaskHi = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset + 4); - uint32x4_t vFgColor = vdupq_n_u32(hwForeColour); - uint32x4_t vBgColor = vdupq_n_u32(hwBackColour); - -#define SEL_BG_FG(p) vpselq(vFgColor, vBgColor, p); - - GENERIC_RGB32_DRAW_PATTERN(SEL_BG_FG); - -} - - - - -__OVERRIDE_WEAK -void __arm_2d_impl_rgb32_draw_pattern_bg_comp(uint8_t *__RESTRICT pchSourceBase, - int32_t iOffset, - int16_t iSourceStride, - uint32_t *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint32_t hwBackColour) -{ - //! get in byte offset - iOffset &= 0x07; - iSourceStride = (iSourceStride + 7) & ~0x07; - - /* deduces offset vector from iOffset for gather loading */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t offSLo = vld1q(__draw_pattern_src_incr_rgb32 + iOffset); - uint32x4_t offSHi = vld1q(__draw_pattern_src_incr_rgb32 + iOffset + 4); - /* deduces bitmask vector with wrap from iOffset */ - /* hold 8 contiguous values into 2 32-bit vector pair */ - uint32x4_t vBitMaskLo = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset); - uint32x4_t vBitMaskHi = vld1q(__draw_pattern_src_bitmask_rgb32 + iOffset + 4); - uint32x4_t vBgColor = vdupq_n_u32(hwBackColour); - -#define SEL_BG_COMP(p) vpselq(vmvnq(vTarg), vBgColor, p); - - GENERIC_RGB32_DRAW_PATTERN(SEL_BG_COMP); - -} - -#endif - - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_ELT_SZ diff --git a/package/Arm2D/Library/Source/__arm_2d_fill_colour.inc b/package/Arm2D/Library/Source/__arm_2d_fill_colour.inc deleted file mode 100644 index faefd1580..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_fill_colour.inc +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_fill_colour.inc - * Description: c code template for drawing pattern - * - * $Date: 14. April 2020 - * $Revision: V.1.0.0 - * - * -------------------------------------------------------------------- */ - - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_INT_TYPE -# error You have to define the __API_INT_TYPE before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __arm_2d_impl_##__COLOUR##_##__NAME -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - - -__WEAK -void __ARM_2D_FUNC(colour_filling)( __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - __API_INT_TYPE Colour) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++){ - pTarget[x] = Colour; - } - pTarget += iTargetStride; - } -} - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_INT_TYPE diff --git a/package/Arm2D/Library/Source/__arm_2d_fill_colour_helium.inc b/package/Arm2D/Library/Source/__arm_2d_fill_colour_helium.inc deleted file mode 100644 index a9e0ac9a0..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_fill_colour_helium.inc +++ /dev/null @@ -1,99 +0,0 @@ - -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_fill_colour_helium.inc - * Description: Helium code template for drawing pattern - * - * $Date: 20. Sept 2021 - * $Revision: V.0.0.1 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif - -#ifndef __API_ELT_SZ -# error You have to define the __API_ELT_SZ before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __arm_2d_impl_##__COLOUR##_##__NAME -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(colour_filling)( ARM_PIX_SCLTYP(__API_ELT_SZ) *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - ARM_PIX_SCLTYP(__API_ELT_SZ) Colour) -{ - ARM_PIX_VECTYP(__API_ELT_SZ) vColor = ARM_CONNECT2(vdupq_n_u, __API_ELT_SZ)(Colour); - -#ifdef USE_MVE_INTRINSICS - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - int32_t blkCnt = ptCopySize->iWidth; - ARM_PIX_SCLTYP(__API_ELT_SZ) *pTargetCur = pTarget; - - while (blkCnt > 0) { - mve_pred16_t tailPred = ARM_CONNECT2(ARM_CONNECT2(vctp, __API_ELT_SZ), q)(blkCnt); - - vst1q_p(pTargetCur, vColor, tailPred); - - pTargetCur += ARM_PIX_VECELT(__API_ELT_SZ); - blkCnt -= ARM_PIX_VECELT(__API_ELT_SZ); - } - - pTarget += iTargetStride; - } - -#else - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - int32_t blkCnt = ptCopySize->iWidth; - ARM_PIX_SCLTYP(__API_ELT_SZ) *pTargetCur = pTarget; - - __asm volatile( - ".p2align 2 \n" - " wlstp." ARM_TO_STRING(__API_ELT_SZ) " lr, %[loopCnt], 1f \n" - "2: \n" - " vstrb.u8 %[vColor], [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - - : [pTarget] "+r" (pTargetCur) - : [loopCnt] "r" (blkCnt), [vColor] "t" (vColor) - :"memory", "lr"); - - pTarget += iTargetStride; - } -#endif -} - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_ELT_SZ - diff --git a/package/Arm2D/Library/Source/__arm_2d_meta_copy_and_fill.inc b/package/Arm2D/Library/Source/__arm_2d_meta_copy_and_fill.inc deleted file mode 100644 index 297c9ed7a..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_meta_copy_and_fill.inc +++ /dev/null @@ -1,1095 +0,0 @@ - -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_meta_copy_and_fill.inc - * Description: c code template for copy and fill like operations - * - * $Date: 13. Sept 2021 - * $Revision: V.1.0.0 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_MCAF_COLOUR -# error You have to define __API_MCAF_COLOUR before using this c template -#endif -#ifndef __API_MCAF_INT_TYPE -# error You have to define the __API_MCAF_INT_TYPE before using this c template -#endif -#ifndef __API_MCAF_INT_TYPE_BIT_NUM -# error You have to define the __API_MCAF_INT_TYPE_BIT_NUM before using this c template -#endif - -#ifndef __API_MCAF_EXTRA_PARAM -# define __API_MCAF_EXTRA_PARAM -#endif - - -#undef ____MCAF_FUNC -#undef ___MCAF_FUNC -#undef __MCAF_FUNC - - -#ifndef __API_MCAF_OP_NAME -# define ____MCAF_FUNC(__NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__NAME -# define ___MCAF_FUNC(__NAME, __COLOUR) ____MCAF_FUNC(__NAME, __COLOUR) -#else -# define _____MCAF_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MCAF_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____MCAF_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___MCAF_FUNC(__NAME, __COLOUR) \ - ____MCAF_FUNC(__API_MCAF_OP_NAME, __NAME, __COLOUR) -#endif - - - -#define __MCAF_FUNC(__NAME) ___MCAF_FUNC(__NAME, __API_MCAF_COLOUR) - - -#undef ____MCAF_TYPE -#undef ___MCAF_TYPE -#undef __MCAF_TYPE - -#ifndef __API_MCAF_OP_NAME -# define ____MCAF_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___MCAF_TYPE(__NAME, __COLOUR) ____MCAF_TYPE(__NAME, __COLOUR) -#else -# define _____MCAF_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MCAF_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____MCAF_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___MCAF_TYPE(__NAME, __COLOUR) \ - ____MCAF_TYPE(__API_MCAF_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __MCAF_TYPE(__NAME) ___MCAF_TYPE(__NAME, __API_MCAF_COLOUR) - -/*----------------------------------------------------------------------------* - * Accelerable Low Level APIs * - *----------------------------------------------------------------------------*/ - - -/*----------------------------------------------------------------------------* - * Fill with mirroring * - *----------------------------------------------------------------------------*/ - -void __MCAF_FUNC(fill_x_mirror)( __API_MCAF_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize - - __API_MCAF_EXTRA_PARAM - ); - -void __MCAF_FUNC(fill_y_mirror)( __API_MCAF_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize - - __API_MCAF_EXTRA_PARAM - ); - -void __MCAF_FUNC(fill_xy_mirror)( __API_MCAF_INT_TYPE * __RESTRICT phwSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize - - __API_MCAF_EXTRA_PARAM - ); - -static -void __MCAF_FUNC(fill_generic)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptTargetSize, - const __MCAF_TYPE(paving_fct_t) * __RESTRICT pPavFct - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_EXPRESSION - __ARM_2D_MEM_FILL_GENERIC( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - pPavFct - ); -#else - __ARM_2D_MEM_FILL_GENERIC( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - pPavFct, - - __API_MCAF_EXTRA_EXPRESSION - ); -#endif - -} - - -/*----------------------------------------------------------------------------* - * Copy with mirroring * - *----------------------------------------------------------------------------*/ -void __MCAF_FUNC(copy_x_mirror)( __API_MCAF_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize - - __API_MCAF_EXTRA_PARAM - ); - -void __MCAF_FUNC(copy_y_mirror)( __API_MCAF_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize - - __API_MCAF_EXTRA_PARAM - ); - -void __MCAF_FUNC(copy_xy_mirror)( __API_MCAF_INT_TYPE *__RESTRICT phwSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize - - __API_MCAF_EXTRA_PARAM - ); - -/*----------------------------------------------------------------------------* - * Paving * - *----------------------------------------------------------------------------*/ -__WEAK -void __MCAF_FUNC(2x2_paving)(const __API_MCAF_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK void __MCAF_FUNC(2x2_paving_x_mirror)( - const __API_MCAF_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK void __MCAF_FUNC(2x2_paving_y_mirror)( - const __API_MCAF_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - -__WEAK void __MCAF_FUNC(2x2_paving_xy_mirror)( - const __API_MCAF_INT_TYPE *__RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairRows, - uint16_t tilePairCols - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK -void __MCAF_FUNC(1x2_paving)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - -__WEAK void __MCAF_FUNC(1x2_paving_x_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - -__WEAK void __MCAF_FUNC(1x2_paving_y_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK void __MCAF_FUNC(1x2_paving_xy_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint32_t destWidth, - uint16_t tilePairRows - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x2(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK -void __MCAF_FUNC(2x1_paving)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - -__WEAK void __MCAF_FUNC(2x1_paving_x_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, - PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - -__WEAK void __MCAF_FUNC(2x1_paving_y_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK void __MCAF_FUNC(2x1_paving_xy_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - const arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - uint16_t tilePairCols, - uint16_t destHeight - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_2x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSourceSize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - - -__WEAK -void __MCAF_FUNC(1x1_paving)(const __API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_DIRECT_START_OFFS(_, _), - PAVING_DIRECT_READ_DIR, - PAVING_DIRECT_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_DIRECT_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - -__WEAK void __MCAF_FUNC(1x1_paving_x_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_X_MIRROR_START_OFFS(_, _), - PAVING_X_MIRROR_READ_DIR, PAVING_X_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_X_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK void __MCAF_FUNC(1x1_paving_y_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_Y_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_Y_MIRROR_READ_DIR, - PAVING_Y_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_Y_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -__WEAK void __MCAF_FUNC(1x1_paving_xy_mirror)( - const __API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - const arm_2d_size_t * __RESTRICT ptSrcCopySize, - const arm_2d_size_t * __RESTRICT ptDstCopySize - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_PAVE_EXPRESSION - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM)); -#else - __ARM_2D_PAVING_1x1(__API_MCAF_INT_TYPE_BIT_NUM, - PAVING_XY_MIRROR_START_OFFS(iSourceStride, ptSrcCopySize->iHeight), - PAVING_XY_MIRROR_READ_DIR, - PAVING_XY_MIRROR_SETUP_COPY(__API_MCAF_INT_TYPE_BIT_NUM), - PAVING_XY_MIRROR_LOAD_PATTERN(__API_MCAF_INT_TYPE_BIT_NUM), - - __API_MCAF_EXTRA_PAVE_EXPRESSION); -#endif -} - - -/*----------------------------------------------------------------------------* - * Copy * - *----------------------------------------------------------------------------*/ - - - - -__WEAK -void __MCAF_FUNC(copy_y_mirror)( __API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_EXPRESSION - __MCAF_FUNC(1x1_paving_y_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -#else - __MCAF_FUNC(1x1_paving_y_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - - __API_MCAF_EXTRA_EXPRESSION); -#endif -} - -__WEAK -void __MCAF_FUNC(copy_x_mirror)(__API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_EXPRESSION - __MCAF_FUNC(1x1_paving_x_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -#else - __MCAF_FUNC(1x1_paving_x_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - - __API_MCAF_EXTRA_EXPRESSION); -#endif -} - -__WEAK -void __MCAF_FUNC(copy_xy_mirror)( __API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_EXPRESSION - __MCAF_FUNC(1x1_paving_xy_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize); -#else - __MCAF_FUNC(1x1_paving_xy_mirror)( pSource, - iSourceStride, - pTarget, - iTargetStride, - ptCopySize, - ptCopySize, - - __API_MCAF_EXTRA_EXPRESSION); -#endif -} - - - - - -/*----------------------------------------------------------------------------* - * Fill * - *----------------------------------------------------------------------------*/ - -__WEAK -void __MCAF_FUNC(fill_x_mirror)( __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize - - __API_MCAF_EXTRA_PARAM - ) -{ - static __MCAF_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__MCAF_FUNC(2x2_paving_x_mirror), - .pav_1x2 = &__MCAF_FUNC(1x2_paving_x_mirror), - .pav_2x1 = &__MCAF_FUNC(2x1_paving_x_mirror), - .pav_1x1 = &__MCAF_FUNC(1x1_paving_x_mirror) - }; - -#ifndef __API_MCAF_EXTRA_EXPRESSION - __MCAF_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, ptTargetSize, &pav_func); -#else - __MCAF_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - - __API_MCAF_EXTRA_EXPRESSION); -#endif -} - -__WEAK void __MCAF_FUNC(fill_y_mirror)( - __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize - - __API_MCAF_EXTRA_PARAM - ) -{ - static __MCAF_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__MCAF_FUNC(2x2_paving_y_mirror), - .pav_1x2 = &__MCAF_FUNC(1x2_paving_y_mirror), - .pav_2x1 = &__MCAF_FUNC(2x1_paving_y_mirror), - .pav_1x1 = &__MCAF_FUNC(1x1_paving_y_mirror) - }; - -#ifndef __API_MCAF_EXTRA_EXPRESSION - __MCAF_FUNC(fill_generic)( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func); -#else - __MCAF_FUNC(fill_generic)( pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - - __API_MCAF_EXTRA_EXPRESSION); -#endif -} - - -__WEAK void __MCAF_FUNC(fill_xy_mirror)( - __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize - - __API_MCAF_EXTRA_PARAM - ) -{ - static __MCAF_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__MCAF_FUNC(2x2_paving_xy_mirror), - .pav_1x2 = &__MCAF_FUNC(1x2_paving_xy_mirror), - .pav_2x1 = &__MCAF_FUNC(2x1_paving_xy_mirror), - .pav_1x1 = &__MCAF_FUNC(1x1_paving_xy_mirror) - }; - -#ifndef __API_MCAF_EXTRA_EXPRESSION - __MCAF_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func); -#else - __MCAF_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - - __API_MCAF_EXTRA_EXPRESSION); -#endif -} - - - -/*----------------------------------------------------------------------------* - * APIs used by external source code * - *----------------------------------------------------------------------------*/ - -/* kept here for references -__WEAK -void __MCAF_FUNC(copy)( __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - memcpy(pTarget, pSource, ptCopySize->iWidth * sizeof(*pSource)); - pSource += iSourceStride; - pTarget += iTargetStride; - } -} -*/ -extern -void __MCAF_FUNC(copy)( __API_INT_TYPE *__RESTRICT pSource, - int16_t iSourceStride, - __API_INT_TYPE *__RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize - - __API_MCAF_EXTRA_PARAM - ); - -__WEAK -void __MCAF_FUNC(copy_mirror)( __API_MCAF_INT_TYPE * __RESTRICT pSource, - int16_t iSourceStride, - __API_MCAF_INT_TYPE * __RESTRICT pTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t wMode - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_EXPRESSION - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __MCAF_FUNC(copy_x_mirror)( pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __MCAF_FUNC(copy_y_mirror)( pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR: - __MCAF_FUNC(copy_xy_mirror)(pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -#else - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __MCAF_FUNC(copy_x_mirror)( pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize, - - __API_MCAF_EXTRA_EXPRESSION); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __MCAF_FUNC(copy_y_mirror)( pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize, - - __API_MCAF_EXTRA_EXPRESSION); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR: - __MCAF_FUNC(copy_xy_mirror)(pSource, iSourceStride, - pTarget, iTargetStride, - ptCopySize, - - __API_MCAF_EXTRA_EXPRESSION); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -#endif -} - - -__WEAK -void __MCAF_FUNC(fill)(__API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize - - __API_MCAF_EXTRA_PARAM - ) -{ - static const __MCAF_TYPE(paving_fct_t) pav_func = { - .pav_2x2 = &__MCAF_FUNC(2x2_paving), - .pav_1x2 = &__MCAF_FUNC(1x2_paving), - .pav_2x1 = &__MCAF_FUNC(2x1_paving), - .pav_1x1 = &__MCAF_FUNC(1x1_paving) - }; - -#ifndef __API_MCAF_EXTRA_EXPRESSION - __MCAF_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func); -#else - __MCAF_FUNC(fill_generic)(pSourceBase, - iSourceStride, - ptSourceSize, - pTargetBase, - iTargetStride, - ptTargetSize, - &pav_func, - - __API_MCAF_EXTRA_EXPRESSION); -#endif -} - -__WEAK -void __MCAF_FUNC(fill_mirror)( __API_MCAF_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - __API_MCAF_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - uint32_t wMode - - __API_MCAF_EXTRA_PARAM - ) -{ -#ifndef __API_MCAF_EXTRA_EXPRESSION - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __MCAF_FUNC(fill_x_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __MCAF_FUNC(fill_y_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR : - __MCAF_FUNC(fill_xy_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -#else - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __MCAF_FUNC(fill_x_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize, - - __API_MCAF_EXTRA_EXPRESSION); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __MCAF_FUNC(fill_y_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize, - - __API_MCAF_EXTRA_EXPRESSION); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR : - __MCAF_FUNC(fill_xy_mirror)( - pSourceBase, iSourceStride, ptSourceSize, - pTargetBase, iTargetStride, ptTargetSize, - - __API_MCAF_EXTRA_EXPRESSION); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -#endif -} - -#undef __API_MCAF_EXTRA_PAVE_EXPRESSION -#undef __API_MCAF_COPY_LIKE_OP_NAME -#undef __API_MCAF_EXTRA_EXPRESSION -#undef __API_MCAF_EXTRA_PARAM -#undef __API_MCAF_OP_NAME -#undef ____MCAF_FUNC -#undef ___MCAF_FUNC -#undef __MCAF_FUNC -#undef __API_MCAF_COLOUR -#undef __API_MCAF_INT_TYPE -#undef __API_MCAF_INT_TYPE_BIT_NUM -#undef ____MCAF_TYPE -#undef ___MCAF_TYPE -#undef __MCAF_TYPE diff --git a/package/Arm2D/Library/Source/__arm_2d_meta_copy_with_masks.inc b/package/Arm2D/Library/Source/__arm_2d_meta_copy_with_masks.inc deleted file mode 100644 index 0ad73aba9..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_meta_copy_with_masks.inc +++ /dev/null @@ -1,1235 +0,0 @@ -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_meta_copy_with_masks.inc - * Description: c code template for copy and fill like operations - * - * $Date: 06. Oct 2021 - * $Revision: V.1.0.0 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_MCWM_COLOUR -# error You have to define __API_MCWM_COLOUR before using this c template -#endif -#ifndef __API_MCWM_INT_TYPE -# error You have to define the __API_MCWM_INT_TYPE before using this c template -#endif -#ifndef __API_MCWM_INT_TYPE_BIT_NUM -# error You have to define the __API_MCWM_INT_TYPE_BIT_NUM before using this c template -#endif -#ifndef __API_MCWM_PIXEL_BLENDING -# error You have to define __API_PIXEL_BLENDING before using this c template -#endif - -/*! disable this feature by default */ -#ifndef __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING 0 -#endif - -#ifndef __API_MCWM_CFG_1_HORIZONTAL_LINE -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -#endif - -#ifndef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 0 -#endif - -#ifndef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 0 -#endif - -#ifndef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 -#endif - - -#undef ____MCWM_FUNC -#undef ___MCWM_FUNC -#undef __MCWM_FUNC - - - -#ifndef __API_MCWM_OP_NAME -# define ____MCWM_FUNC(__NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__NAME -# define ___MCWM_FUNC(__NAME, __COLOUR) ____MCWM_FUNC(__NAME, __COLOUR) -#else -# define _____MCWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MCWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____MCWM_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___MCWM_FUNC(__NAME, __COLOUR) \ - ____MCWM_FUNC(__API_MCWM_OP_NAME, __NAME, __COLOUR) -#endif - -#define __MCWM_FUNC(__NAME) ___MCWM_FUNC(__NAME, __API_MCWM_COLOUR) - - -#undef ____MCWM_TYPE -#undef ___MCWM_TYPE -#undef __MCWM_TYPE - -#ifndef __API_MCWM_OP_NAME -# define ____MCWM_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___MCWM_TYPE(__NAME, __COLOUR) ____MCWM_TYPE(__NAME, __COLOUR) -#else -# define _____MCWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MCWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____MCWM_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___MCWM_TYPE(__NAME, __COLOUR) \ - ____MCWM_TYPE(__API_MCWM_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __MCWM_TYPE(__NAME) ___MCWM_TYPE(__NAME, __API_MCWM_COLOUR) - - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (both masks) * - *----------------------------------------------------------------------------*/ - -__WEAK -void __MCWM_FUNC(masks_fill)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - for (int_fast16_t x = 0; x < wLength; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(ptSrcMsk++) - #else - (*ptSrcMsk++) - #endif - - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - - __API_MCWM_PIXEL_BLENDING(ptSrc++, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - -__WEAK -void __MCWM_FUNC(masks_fill_x_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - ptSrc += ptSourceSize->iWidth - 1; - ptSrcMsk += ptSourceSize->iWidth - 1; - - for (int_fast16_t x = 0; x < wLength; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(ptSrcMsk--) - #else - (*ptSrcMsk--) - #endif - - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - - __API_MCWM_PIXEL_BLENDING(ptSrc--, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - - -} - -__WEAK -void __MCWM_FUNC(masks_fill_y_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - for (int_fast16_t x = 0; x < wLength; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(ptSrcMsk++) - #else - (*ptSrcMsk++) - #endif - - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - __API_MCWM_PIXEL_BLENDING(ptSrc++, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - -} - -__WEAK -void __MCWM_FUNC(masks_fill_xy_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - - ptSrc += ptSourceSize->iWidth - 1; - ptSrcMsk += ptSourceSize->iWidth - 1; - - - for (int_fast16_t x = 0; x < wLength; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(ptSrcMsk--) - #else - (*ptSrcMsk--) - #endif - - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - __API_MCWM_PIXEL_BLENDING(ptSrc--, ptTarget++, hwOpacity); - } - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } - -} - - -__WEAK -void __MCWM_FUNC(masks_fill_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __MCWM_FUNC(masks_fill_x_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptSourceMaskBase, iSourceMaskStride, ptSourceMaskSize, - ptTargetBase, iTargetStride, ptTargetSize, - ptTargetMaskBase, iTargetMaskStride, ptTargetMaskSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __MCWM_FUNC(masks_fill_y_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptSourceMaskBase, iSourceMaskStride, ptSourceMaskSize, - ptTargetBase, iTargetStride, ptTargetSize, - ptTargetMaskBase, iTargetMaskStride, ptTargetMaskSize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR : - __MCWM_FUNC(masks_fill_xy_mirror)( - ptSourceBase, iSourceStride, ptSourceSize, - ptSourceMaskBase, iSourceMaskStride, ptSourceMaskSize, - ptTargetBase, iTargetStride, ptTargetSize, - ptTargetMaskBase, iTargetMaskStride, ptTargetMaskSize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - - -/*----------------------------------------------------------------------------* - * Copy with Mirroring (both masks) * - *----------------------------------------------------------------------------*/ -__WEAK -void __MCWM_FUNC(masks_copy)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - //uint16_t hwRatioCompl = 256 - chRatio; - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(ptSourceMask++) - #else - (*ptSourceMask++) - #endif - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - - __API_MCWM_PIXEL_BLENDING( pSourceBase++, pTargetBase++, hwOpacity); - - } - pSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += (iSourceMaskStride - iWidth); - } - #else - ptSourceMask += (iSourceMaskStride - iWidth); - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - } -} - - -__WEAK -void __MCWM_FUNC(masks_copy_x_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - __API_MCWM_INT_TYPE *ptTargetCur = pTargetBase; - __API_MCWM_INT_TYPE *ptSourceCur = pSourceBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *pchSourceMaskCur = ptSourceMask; - #else - uint8_t *pchSourceMaskCur = ptSourceMask; - #endif - - ptSourceCur += ptCopySize->iWidth - 1; - //! \note do not use ptSourceMaskSize->iWidth - pchSourceMaskCur += ptCopySize->iWidth - 1; - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(pchSourceMaskCur--) - #else - (*pchSourceMaskCur--) - #endif - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - - __API_MCWM_PIXEL_BLENDING( ptSourceCur--, ptTargetCur++, hwOpacity); - - } - pSourceBase += iSourceStride; - pTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - - } -} - - -__WEAK -void __MCWM_FUNC(masks_copy_y_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - //uint16_t hwRatioCompl = 256 - chRatio; - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - __API_MCWM_INT_TYPE *ptSourceCur = pSourceBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *pchSourceMaskCur = ptSourceMask; - #else - uint8_t *pchSourceMaskCur = ptSourceMask; - #endif - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(pchSourceMaskCur++) - #else - (*pchSourceMaskCur++) - #endif - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - - __API_MCWM_PIXEL_BLENDING( ptSourceCur++, pTargetBase++, hwOpacity); - - } - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride - iWidth); - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - } - -} - - -__WEAK -void __MCWM_FUNC(masks_copy_xy_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - //uint16_t hwRatioCompl = 256 - chRatio; - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - __API_MCWM_INT_TYPE *ptSourceCur = pSourceBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *pchSourceMaskCur = ptSourceMask; - #else - uint8_t *pchSourceMaskCur = ptSourceMask; - #endif - - ptSourceCur += ptCopySize->iWidth - 1; - //! \note do not use ptSourceMaskSize->iWidth - pchSourceMaskCur += ptCopySize->iWidth - 1; - - for (int_fast16_t x = 0; x < iWidth; x++) { - uint16_t hwOpacity = - 256 - ( - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - *(uint8_t *)(pchSourceMaskCur--) - #else - (*pchSourceMaskCur--) - #endif - * - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - *(uint8_t *)(ptTargetMask++) - #else - (*ptTargetMask++) - #endif - - >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwOpacity -= (hwOpacity == 2) * 2; - #endif - - __API_MCWM_PIXEL_BLENDING( ptSourceCur--, pTargetBase++, hwOpacity); - - } - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride - iWidth); - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride - iWidth); - #endif - } - -} - -__WEAK -void __MCWM_FUNC(masks_copy_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t wMode) -{ - switch (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - case ARM_2D_CP_MODE_X_MIRROR: - __MCWM_FUNC(masks_copy_x_mirror)(pSourceBase, iSourceStride, - ptSourceMaskBase, iSourceMaskStride, - ptSourceMaskSize, - pTargetBase, iTargetStride, - ptTargetMaskBase, iTargetMaskStride, - ptTargetMaskSize, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR: - __MCWM_FUNC(masks_copy_y_mirror)(pSourceBase, iSourceStride, - ptSourceMaskBase, iSourceMaskStride, - ptSourceMaskSize, - pTargetBase, iTargetStride, - ptTargetMaskBase, iTargetMaskStride, - ptTargetMaskSize, - ptCopySize); - break; - case ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR: - __MCWM_FUNC(masks_copy_xy_mirror)(pSourceBase, iSourceStride, - ptSourceMaskBase, iSourceMaskStride, - ptSourceMaskSize, - pTargetBase, iTargetStride, - ptTargetMaskBase, iTargetMaskStride, - ptTargetMaskSize, - ptCopySize); - break; - default: - assert(false); /*! this should not happen */ - //break; - } -} - - -#undef masks_fill -#undef masks_fill_x_mirror -#undef masks_fill_y_mirror -#undef masks_fill_xy_mirror -#undef masks_fill_mirror - - -#undef masks_copy -#undef masks_copy_x_mirror -#undef masks_copy_y_mirror -#undef masks_copy_xy_mirror -#undef masks_copy_mirror - - -#undef __API_MCWM_COPY_LIKE_OP_NAME -#undef __API_MCWM_OP_NAME -#undef __API_MCWM_PIXEL_BLENDING -#undef ____MCWM_FUNC -#undef ___MCWM_FUNC -#undef __MCWM_FUNC -#undef __API_MCWM_COLOUR -#undef __API_MCWM_INT_TYPE -#undef __API_MCWM_INT_TYPE_BIT_NUM -#undef ____MCWM_TYPE -#undef ___MCWM_TYPE -#undef __MCWM_TYPE -#undef __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING -#undef __API_MCWM_CFG_1_HORIZONTAL_LINE -#undef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT -#undef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -#undef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE diff --git a/package/Arm2D/Library/Source/__arm_2d_meta_copy_with_masks_helium.inc b/package/Arm2D/Library/Source/__arm_2d_meta_copy_with_masks_helium.inc deleted file mode 100644 index a93c179d7..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_meta_copy_with_masks_helium.inc +++ /dev/null @@ -1,1881 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_meta_copy_with_masks_helium.inc - * Description: c code template for copy and fill like operations - * - * $Date: 12. July 2022 - * $Revision: v1.0.1 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_MCWM_COLOUR -# error You have to define __API_MCWM_COLOUR before using this c template -#endif - -#include "__arm_2d_math_helium.h" - - -#if CHECKPIXTYP(__API_MCWM_COLOUR, rgb565) -#define __API_MCWM_PIXEL_BIT_NUM 16 -#define __API_MCWM_PIXEL_VECLOAD vld1q -#define __API_MCWM_PIXEL_GATHVECLOAD vldrhq_gather_shifted_offset -#define __API_MCWM_PIXEL_PVECSTORE vst1q_p -#define __API_MCWM_PIXEL_BLENDING __arm_2d_rgb565_blending_opacity_single_vec - -#elif CHECKPIXTYP(__API_MCWM_COLOUR, gray8) -#define __API_MCWM_PIXEL_BIT_NUM 16 /* widening involved */ -#define __API_MCWM_PIXEL_VECLOAD vldrbq_u16 -#define __API_MCWM_PIXEL_GATHVECLOAD vldrbq_gather_offset_u16 -#define __API_MCWM_PIXEL_PVECSTORE vstrbq_p_u16 -#define __API_MCWM_PIXEL_BLENDING __arm_2d_gray8_blending_opacity_single_vec - -#elif CHECKPIXTYP(__API_MCWM_COLOUR, cccn888) -#if !ENABLE_ALT_MASK_FILL -#define __API_MCWM_PIXEL_BIT_NUM 32 -#define __API_MCWM_PIXEL_VECLOAD vld1q -#define __API_MCWM_PIXEL_GATHVECLOAD vldrwq_gather_shifted_offset -#define __API_MCWM_PIXEL_PVECSTORE vst1q_p -#define __API_MCWM_PIXEL_BLENDING __arm_2d_cccn888_blending_opacity_single_vec -#else -#define __API_MCWM_PIXEL_BIT_NUM 16 /* widening involved */ -#define __API_MCWM_PIXEL_VECLOAD vldrbq_u16 -#define __API_MCWM_PIXEL_GATHVECLOAD vldrbq_gather_offset_u16 -#define __API_MCWM_PIXEL_PVECSTORE vstrbq_p_u16 -#define __API_MCWM_PIXEL_BLENDING __arm_2d_gray8_blending_opacity_single_vec -#endif - -#else -#error Unknown colour -#endif - -#define __API_MCWM_PIXEL_VECTYP ARM_PIX_VECTYP(__API_MCWM_PIXEL_BIT_NUM) -#define __API_MCWM_VEC_INCR ARM_PIX_VECELT(__API_MCWM_PIXEL_BIT_NUM) - -/*! disable this feature by default */ -#ifndef __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING 0 -#endif - -#ifndef __API_MCWM_CFG_1_HORIZONTAL_LINE -# define __API_MCWM_CFG_1_HORIZONTAL_LINE 0 -#endif - -#ifndef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT 0 -#endif - -#ifndef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 0 -#endif - -#ifndef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE -# define __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 -#endif - - -#undef ____MCWM_FUNC -#undef ___MCWM_FUNC -#undef __MCWM_FUNC - - - -#ifndef __API_MCWM_OP_NAME -# define ____MCWM_FUNC(__NAME, __COLOUR) \ - __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__NAME) -# define ___MCWM_FUNC(__NAME, __COLOUR) ____MCWM_FUNC(__NAME, __COLOUR) -#else -# define _____MCWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME) -# define ____MCWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____MCWM_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___MCWM_FUNC(__NAME, __COLOUR) \ - ____MCWM_FUNC(__API_MCWM_OP_NAME, __NAME, __COLOUR) -#endif - -#define __MCWM_FUNC(__NAME) ___MCWM_FUNC(__NAME, __API_MCWM_COLOUR) - - -#undef ____MCWM_TYPE -#undef ___MCWM_TYPE -#undef __MCWM_TYPE - -#ifndef __API_MCWM_OP_NAME -# define ____MCWM_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___MCWM_TYPE(__NAME, __COLOUR) ____MCWM_TYPE(__NAME, __COLOUR) -#else -# define _____MCWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MCWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____MCWM_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___MCWM_TYPE(__NAME, __COLOUR) \ - ____MCWM_TYPE(__API_MCWM_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __MCWM_TYPE(__NAME) ___MCWM_TYPE(__NAME, __API_MCWM_COLOUR) - - -/*----------------------------------------------------------------------------* - * Fill with Mirroring (both masks) * - *----------------------------------------------------------------------------*/ - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_fill)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = wLength; - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = __API_MCWM_PIXEL_VECLOAD(ptSrc); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, - __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, - __API_MCWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = __API_MCWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk += __API_MCWM_VEC_INCR; - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - - ptTargetCur += __API_MCWM_VEC_INCR; - ptSrc += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - ptTarget += wLength; - ptTargetMask += wLength; - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - - -#if CHECKPIXTYP(__API_MCWM_COLOUR, cccn888) && ENABLE_ALT_MASK_FILL - -/* Alternative 32-bit fill with mask */ -/* Operates on individual cccn888 pixel channel */ -/* requires slower scat/gather for channel extraction */ -/* but allows faster processing with vector of 8 elements */ -/* slightly faster than version above but deviates from 8 & 16-bit template versions */ - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_fill_alt)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - - /* - * chan 0 (scat / gath with 8x16 elements ) - */ - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = wLength; - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = vldrbq_gather_offset_u16((uint8_t*)ptTargetCur, vIncStride4Offs); - __API_MCWM_PIXEL_VECTYP vecSource = vldrbq_gather_offset_u16((uint8_t*)ptSrc, vIncStride4Offs); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = vldrbq_gather_offset_u16( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = vldrbq_gather_offset_u16( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = __arm_2d_gray8_blending_opacity_single_vec( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - vstrbq_scatter_offset_p_u16((uint8_t*)ptTargetCur, vIncStride4Offs, - vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk += __API_MCWM_VEC_INCR; - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - - ptTargetCur += __API_MCWM_VEC_INCR; - ptSrc += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - - /* - * chan 1 (scat / gath with 8x16 elements ) - */ - ptSrc = ptSource; - ptTargetCur = ptTarget; - - curIncStride4Idx = 0; - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk = ptSourceMask; - #else - ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur = ptTargetMask; - #else - ptTargetMaskCur = ptTargetMask; - #endif - blkCnt = wLength; - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = vldrbq_gather_offset_u16(((uint8_t*)ptTargetCur)+1, vIncStride4Offs); - __API_MCWM_PIXEL_VECTYP vecSource = vldrbq_gather_offset_u16(((uint8_t*)ptSrc)+1, vIncStride4Offs); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = vldrbq_gather_offset_u16( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = vldrbq_gather_offset_u16( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = __arm_2d_gray8_blending_opacity_single_vec( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - vstrbq_scatter_offset_p_u16(((uint8_t*)ptTargetCur)+1, vIncStride4Offs, - vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk += __API_MCWM_VEC_INCR; - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - - ptTargetCur += __API_MCWM_VEC_INCR; - ptSrc += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - - /* - * chan 2 (scat / gath with 8x16 elements ) - */ - ptSrc = ptSource; - ptTargetCur = ptTarget; - - curIncStride4Idx = 0; - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk = ptSourceMask; - #else - ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur = ptTargetMask; - #else - ptTargetMaskCur = ptTargetMask; - #endif - blkCnt = wLength; - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = vldrbq_gather_offset_u16(((uint8_t*)ptTargetCur)+2, vIncStride4Offs); - __API_MCWM_PIXEL_VECTYP vecSource = vldrbq_gather_offset_u16(((uint8_t*)ptSrc)+2, vIncStride4Offs); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = vldrbq_gather_offset_u16( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = vldrbq_gather_offset_u16( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = __arm_2d_gray8_blending_opacity_single_vec( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - vstrbq_scatter_offset_p_u16(((uint8_t*)ptTargetCur)+2, vIncStride4Offs, - vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk += __API_MCWM_VEC_INCR; - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - - ptTargetCur += __API_MCWM_VEC_INCR; - ptSrc += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - - ptTarget += wLength; - ptTargetMask += wLength; - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - -#endif - - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_fill_x_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - uint16_t srcWidth = ptSourceSize->iWidth; -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource = ptSourceBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = srcWidth - 1; - int32_t blkCnt = wLength; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t curDecrStride4Idx = 4*(srcWidth - 1); - __API_MCWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_MCWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = - __API_MCWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM) - ((uint8_t *)ptSrcMsk, vDecrStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM) - (ptSrcMsk, vDecrStride1Offs); - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = - __API_MCWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - ptTargetCur += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - - ptTarget += wLength; - ptTargetMask += wLength; - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_fill_y_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = wLength; - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = __API_MCWM_PIXEL_VECLOAD(ptSrc); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = __API_MCWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk += __API_MCWM_VEC_INCR; - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - - ptTargetCur += __API_MCWM_VEC_INCR; - ptSrc += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - ptTarget += wLength; - ptTargetMask += wLength; - - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_fill_xy_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t *__RESTRICT ptSourceSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE *__RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptTargetSize, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize) -{ - assert(ptSourceSize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptSourceSize->iHeight - 1); - - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - __API_MCWM_INT_TYPE srcWidth = ptSourceSize->iWidth; -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#else - uint8_t *__RESTRICT ptTargetMaskLineBase = ptTargetMaskBase; -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - - //! reset source - __API_MCWM_INT_TYPE *__RESTRICT ptSource - = ptSourceBase + iSourceStride * (ptSourceSize->iHeight - 1); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; - #else - uint8_t *ptSourceMask = ptSourceMaskBase; - #endif - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - __API_MCWM_INT_TYPE *__RESTRICT ptTarget = ptTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #else - uint8_t *__RESTRICT ptTargetMask = ptTargetMaskLineBase; - #endif - - /*---------------- Height Loop Begin----------------*/ - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - /*---------------- Width Loop Begin----------------*/ - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = ptSource; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = ptTarget; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = srcWidth - 1; - int32_t blkCnt = wLength; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t curDecrStride4Idx = 4*(srcWidth - 1); - __API_MCWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_MCWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = - __API_MCWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)((uint8_t *)ptSrcMsk, vDecrStride4Offs); - - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk, vDecrStride1Offs); - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = - __API_MCWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - ptTargetCur += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - - ptTarget += wLength; - ptTargetMask += wLength; - /*---------------- Width Loop End----------------*/ - wLengthLeft -= wLength; - } while (wLengthLeft); - - /*---------------- Height Loop End----------------*/ - ptSource -= iSourceStride; - ptTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMaskLineBase = ptTargetMaskBase; - #else - ptTargetMaskLineBase += iTargetMaskStride; - #endif - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - - -/*----------------------------------------------------------------------------* - * Copy with Mirroring (both masks) * - *----------------------------------------------------------------------------*/ - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_copy)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, -#else - uint8_t * __RESTRICT ptSourceMaskBase, -#endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, -#else - uint8_t *__RESTRICT ptTargetMaskBase, -#endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = iWidth; - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = __API_MCWM_PIXEL_VECLOAD(ptSrc); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = __API_MCWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk += __API_MCWM_VEC_INCR; - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - - ptTargetCur += __API_MCWM_VEC_INCR; - ptSrc += __API_MCWM_VEC_INCR; - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase += (iSourceStride); - pTargetBase += (iTargetStride); - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += (iSourceMaskStride); - } - #else - ptSourceMask += (iSourceMaskStride); - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - } -} - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_copy_x_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = iWidth - 1; - int32_t blkCnt = iWidth; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t curDecrStride4Idx = 4*(iWidth - 1); - __API_MCWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_MCWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = - __API_MCWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)((uint8_t *)ptSrcMsk, vDecrStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk, vDecrStride1Offs); - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = - __API_MCWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - ptTargetCur += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - - pSourceBase += iSourceStride; - pTargetBase += iTargetStride; - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask += iSourceMaskStride; - } - #else - ptSourceMask += iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - - } -} - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_copy_y_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - int32_t blkCnt = iWidth; - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = __API_MCWM_PIXEL_VECLOAD(ptSrc); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptSrcMsk, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)(ptTargetMaskCur); - #endif - - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = __API_MCWM_PIXEL_BLENDING( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, - ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE || \ - __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - ptSrcMsk += __API_MCWM_VEC_INCR; - #endif - - #if !__API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - - ptTargetCur += __API_MCWM_VEC_INCR; - ptSrc += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride); - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - } - -} - - -__OVERRIDE_WEAK -void __MCWM_FUNC(masks_copy_xy_mirror)( - __API_MCWM_INT_TYPE * __RESTRICT pSourceBase, - int16_t iSourceStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t * __RESTRICT ptSourceMaskBase, - #else - uint8_t * __RESTRICT ptSourceMaskBase, - #endif - int16_t iSourceMaskStride, - arm_2d_size_t *__RESTRICT ptSourceMaskSize, - - __API_MCWM_INT_TYPE * __RESTRICT pTargetBase, - int16_t iTargetStride, - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskBase, - #else - uint8_t *__RESTRICT ptTargetMaskBase, - #endif - int16_t iTargetMaskStride, - arm_2d_size_t *__RESTRICT ptTargetMaskSize, - - arm_2d_size_t * __RESTRICT ptCopySize) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __API_MCWM_PIXEL_VECTYP v256 = ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(256); - - pSourceBase += iSourceStride * (ptCopySize->iHeight - 1); - - assert (ptCopySize->iHeight <= ptSourceMaskSize->iHeight); - ptSourceMaskBase += iSourceMaskStride * (ptCopySize->iHeight - 1); - - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *ptSourceMask = ptSourceMaskBase; -#else - uint8_t *ptSourceMask = ptSourceMaskBase; -#endif - -#if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *ptTargetMask = ptTargetMaskBase; -#else - uint8_t *ptTargetMask = ptTargetMaskBase; -#endif - -#if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; -#endif - - for ( int_fast16_t y = 0; - y < iHeight; - y++) { - __API_MCWM_INT_TYPE *__RESTRICT ptSrc = pSourceBase; - __API_MCWM_INT_TYPE *__RESTRICT ptTargetCur = pTargetBase; - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t curIncStride4Idx = 0; - __API_MCWM_PIXEL_VECTYP vIncStride4Offs = - ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #endif - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t *__RESTRICT ptSrcMsk = ptSourceMask; - #else - uint8_t *__RESTRICT ptSrcMsk = ptSourceMask; - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - uint32_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #else - uint8_t *__RESTRICT ptTargetMaskCur = ptTargetMask; - #endif - - uint32_t curDecrStride1Idx = iWidth - 1; - int32_t blkCnt = iWidth; - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint32_t curDecrStride4Idx = 4*(iWidth - 1); - __API_MCWM_PIXEL_VECTYP vDecrStride4Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - __API_MCWM_PIXEL_VECTYP vDecrStride1Offs = - ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - do { - __API_MCWM_PIXEL_VECTYP vecTarget = __API_MCWM_PIXEL_VECLOAD(ptTargetCur); - __API_MCWM_PIXEL_VECTYP vecSource = - __API_MCWM_PIXEL_GATHVECLOAD(ptSrc, vDecrStride1Offs); - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)((uint8_t *)ptSrcMsk, vDecrStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecSrcMsk = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)(ptSrcMsk, vDecrStride1Offs); - #endif - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_gather_offset_u, __API_MCWM_PIXEL_BIT_NUM)( - (uint8_t const *)ptTargetMaskCur, vIncStride4Offs); - #else - __API_MCWM_PIXEL_VECTYP vecTargetMask = - ARM_CONNECT2(vldrbq_u, __API_MCWM_PIXEL_BIT_NUM)((uint8_t *)ptTargetMaskCur); - #endif - __API_MCWM_PIXEL_VECTYP vecHwOpacity = - vsubq(v256, (vecSrcMsk * vecTargetMask) >> 8); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - vecHwOpacity = vpselq(ARM_CONNECT2(vdupq_n_u, __API_MCWM_PIXEL_BIT_NUM)(0),vecHwOpacity, - ARM_CONNECT2(vcmpeqq_n_u, __API_MCWM_PIXEL_BIT_NUM)(vecHwOpacity, 2)); - #endif - - vecTarget = - __API_MCWM_PIXEL_BLENDING(vecTarget, vecSource, - vecHwOpacity); - - /* tail predication */ - __API_MCWM_PIXEL_PVECSTORE(ptTargetCur, vecTarget, ARM_CONNECT3(vctp, __API_MCWM_PIXEL_BIT_NUM, q)(blkCnt)); - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - vDecrStride4Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride4Idx, 4); - #endif - vDecrStride1Offs = ARM_CONNECT2(vddupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curDecrStride1Idx, 1); - - - #if __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE - vIncStride4Offs = ARM_CONNECT2(vidupq_wb_u, __API_MCWM_PIXEL_BIT_NUM)(&curIncStride4Idx, 4); - #else - ptTargetMaskCur += __API_MCWM_VEC_INCR; - #endif - ptTargetCur += __API_MCWM_VEC_INCR; - - blkCnt -= __API_MCWM_VEC_INCR; - } - while (blkCnt > 0); - - pSourceBase -= iSourceStride; - pTargetBase += (iTargetStride); - - #if __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING - //! handle source mask - iSourceMaskY++; - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= iHeight)) { - ptSourceMask = ptSourceMaskBase; - iSourceMaskY = 0; - } else { - ptSourceMask -= iSourceMaskStride; - } - #else - ptSourceMask -= iSourceMaskStride; - #endif - - #if __API_MCWM_CFG_1_HORIZONTAL_LINE - ptTargetMask = ptTargetMaskBase; - #else - ptTargetMask += (iTargetMaskStride); - #endif - } - -} - - -#undef masks_fill -#undef masks_fill_x_mirror -#undef masks_fill_y_mirror -#undef masks_fill_xy_mirror -#undef masks_fill_mirror - - -#undef masks_copy -#undef masks_copy_x_mirror -#undef masks_copy_y_mirror -#undef masks_copy_xy_mirror -#undef masks_copy_mirror - - -#undef __API_MCWM_COPY_LIKE_OP_NAME -#undef __API_MCWM_OP_NAME -#undef ____MCWM_FUNC -#undef ___MCWM_FUNC -#undef __MCWM_FUNC -#undef __API_MCWM_COLOUR -#undef ____MCWM_TYPE -#undef ___MCWM_TYPE -#undef __MCWM_TYPE -#undef __API_MCWM_PIXEL_BIT_NUM -#undef __API_MCWM_PIXEL_VECLOAD -#undef __API_MCWM_PIXEL_PVECSTORE -#undef __API_MCWM_PIXEL_BLENDING -#undef __API_MCWM_PIXEL_GATHVECLOAD -#undef __API_MCWM_VEC_INCR -#undef __API_MCWM_CFG_SUPPORT_SRC_MSK_WRAPING -#undef __API_MCWM_CFG_1_HORIZONTAL_LINE -#undef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT -#undef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -#undef __API_MCWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE diff --git a/package/Arm2D/Library/Source/__arm_2d_meta_trans_with_masks.inc b/package/Arm2D/Library/Source/__arm_2d_meta_trans_with_masks.inc deleted file mode 100644 index 2c25638da..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_meta_trans_with_masks.inc +++ /dev/null @@ -1,692 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_meta_trans_with_masks.inc - * Description: c code template for copy and fill like operations - * - * $Date: 24. May 2022 - * $Revision: V.1.1.1 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_MTWM_COLOUR -# error You have to define __API_MTWM_COLOUR before using this c template -#endif -#ifndef __API_MTWM_INT_TYPE -# error You have to define the __API_MTWM_INT_TYPE before using this c template -#endif -#ifndef __API_MTWM_INT_TYPE_BIT_NUM -# error You have to define the __API_MTWM_INT_TYPE_BIT_NUM before using this c template -#endif -#ifndef __API_MTWM_PIXEL_BLENDING -# error You have to define __API_MTWM_PIXEL_BLENDING before using this c template -#endif -#ifndef __API_MTWM_PIXEL_AVERAGE -# error You have to define __API_MTWM_PIXEL_AVERAGE before using this c template -#endif -#ifndef __API_MTWM_PIXEL_AVERAGE_RESULT -# error You have to define __API_MTWM_PIXEL_AVERAGE_RESULT before using this c template -#endif -#ifndef __API_MTWM_PIXEL_AVERAGE_INIT -# define __API_MTWM_PIXEL_AVERAGE_INIT() __arm_2d_color_fast_rgb_t tPixel = {0}; -#endif - - -/*! disable this feature by default */ -#ifndef __API_MTWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MTWM_CFG_SUPPORT_SRC_MSK_WRAPING 0 -#endif - -//#ifndef __API_MTWM_CFG_1_HORIZONTAL_LINE -//# define __API_MTWM_CFG_1_HORIZONTAL_LINE 0 -//#endif - -//#ifndef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT -//# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT 0 -//#endif - -#ifndef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 0 -#endif - -//#ifndef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE -//# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 -//#endif - -#ifndef __API_MTWM_CFG_SUPPORT_SOURCE_MASK -# define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 0 -#endif - -//#ifndef __API_MTWM_CFG_SUPPORT_TARGET_MASK -//# define __API_MTWM_CFG_SUPPORT_TARGET_MASK 0 -//#endif - -#ifndef __API_MTWM_CFG_SUPPORT_OPACITY -# define __API_MTWM_CFG_SUPPORT_OPACITY 0 -#endif - -#undef ____MTWM_FUNC -#undef ___MTWM_FUNC -#undef __MTWM_FUNC - - - -#ifndef __API_MTWM_OP_NAME -# define ____MTWM_FUNC(__NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__NAME -# define ___MTWM_FUNC(__NAME, __COLOUR) ____MTWM_FUNC(__NAME, __COLOUR) -#else -# define _____MTWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MTWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____MTWM_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___MTWM_FUNC(__NAME, __COLOUR) \ - ____MTWM_FUNC(__API_MTWM_OP_NAME, __NAME, __COLOUR) -#endif - -#define __MTWM_FUNC(__NAME) ___MTWM_FUNC(__NAME, __API_MTWM_COLOUR) - - -#undef ____MTWM_TYPE -#undef ___MTWM_TYPE -#undef __MTWM_TYPE - -#ifndef __API_MTWM_OP_NAME -# define ____MTWM_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___MTWM_TYPE(__NAME, __COLOUR) ____MTWM_TYPE(__NAME, __COLOUR) -#else -# define _____MTWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MTWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____MTWM_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___MTWM_TYPE(__NAME, __COLOUR) \ - ____MTWM_TYPE(__API_MTWM_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __MTWM_TYPE(__NAME) ___MTWM_TYPE(__NAME, __API_MTWM_COLOUR) - -#define MASK_COLOR(sz) (sz == 8) ? ptInfo->Mask.chColour : ((sz == 16) ? ptInfo->Mask.hwColour : ptInfo->Mask.wColour) - -/*============================ PROTOTYPES ====================================*/ -extern -void __MTWM_FUNC(transform_with_mask)( - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_msk_t *ptThis, - #else - __arm_2d_param_copy_orig_t *ptParam, - #endif - __arm_2d_transform_info_t *ptInfo - #if __API_MTWM_CFG_SUPPORT_OPACITY - ,uint_fast16_t hwOpacity - #endif - ); - -/*============================ IMPLEMENTATION ================================*/ - -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - -static -void __MTWM_FUNC(get_pixel_colour_mask)(arm_2d_point_float_t *ptPoint, - arm_2d_region_t *ptOrigValidRegion, - __API_INT_TYPE *pOrigin, - int16_t iOrigStride, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t *pchOrigMask, - int16_t iOrigMaskStride, - #else - __API_INT_TYPE MaskColour, - #endif - - #if __API_MTWM_CFG_SUPPORT_OPACITY - uint16_t hwOpacity, - #endif - __API_INT_TYPE *pTarget) -{ -#if __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - iOrigMaskStride *= 4; -#endif - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) \ - && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - - arm_2d_location_t tOriginLocation; - - tOriginLocation.iX = ptPoint->fX; - tOriginLocation.iY = ptPoint->fY; - - __arm_2d_point_adj_alpha_t tAdjacentArray - = __arm_2d_point_get_adjacent_alpha_fp(ptPoint); - - __API_PIXEL_AVERAGE_INIT(); - - //__API_INT_TYPE TempPixel; - bool bIsInside = false; - uint16_t hwTransparency = 0; - - for (int_fast8_t n = 0; n < 4; n++) { - uint16_t hwAlpha = tAdjacentArray.tMatrix[n].chAlpha; - - arm_2d_location_t tTemp = { - .iX = tOriginLocation.iX + tAdjacentArray.tMatrix[n].tOffset.iX, - .iY = tOriginLocation.iY + tAdjacentArray.tMatrix[n].tOffset.iY, - }; - - uint16_t hwPixelAlpha = 0; - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - __API_INT_TYPE Temp = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - - #if __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX * 4]; - #else - hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX]; - #endif - - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwPixelAlpha = hwPixelAlpha * hwOpacity >> 8; - assert(hwOpacity != 255); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwPixelAlpha += (hwPixelAlpha == 255); - #endif - - hwPixelAlpha = hwPixelAlpha * hwAlpha >> 8; - - __API_MTWM_PIXEL_AVERAGE(Temp, hwPixelAlpha); - - bIsInside = true; - #else - if (Temp != MaskColour) { - bIsInside = true; - hwPixelAlpha = hwAlpha; - __API_MTWM_PIXEL_AVERAGE(Temp, hwAlpha); - } - #endif - } - - hwTransparency += hwAlpha - hwPixelAlpha; - - } - - if (bIsInside) { - __API_MTWM_PIXEL_AVERAGE(*pTarget, hwTransparency); - - #if __API_MTWM_CFG_SUPPORT_OPACITY && !__API_MTWM_CFG_SUPPORT_SOURCE_MASK - __API_INT_TYPE tSourcPixel = __API_PIXEL_AVERAGE_RESULT(); - __API_MTWM_PIXEL_BLENDING( &tSourcPixel, pTarget, hwOpacity); - #else - *pTarget = __API_PIXEL_AVERAGE_RESULT(); - #endif - - } - -#else - arm_2d_location_t tTemp; - - tTemp.iX = ptPoint->fX; - tTemp.iY = ptPoint->fY; - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - __API_INT_TYPE Temp = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - #if __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint16_t hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX * 4]; - #else - uint16_t hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX]; - #endif - - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwPixelAlpha = hwPixelAlpha * hwOpacity >> 8; - assert(hwOpacity != 255); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwPixelAlpha += (hwPixelAlpha == 255); - #endif - - __API_MTWM_PIXEL_BLENDING( &Temp, pTarget, hwPixelAlpha); - #else - - if (Temp != MaskColour) { - #if __API_MTWM_CFG_SUPPORT_OPACITY - __API_MTWM_PIXEL_BLENDING( &Temp, pTarget, hwOpacity); - #else - *pTarget = Temp; - #endif - } - #endif - } - -#endif -} - -__WEAK -void __MTWM_FUNC(transform_with_mask)( - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_msk_t *ptThis, - #else - __arm_2d_param_copy_orig_t *ptParam, - #endif - __arm_2d_transform_info_t *ptInfo - #if __API_MTWM_CFG_SUPPORT_OPACITY - ,uint_fast16_t hwOpacity - #endif - ) -{ -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_t *ptParam = - &(ptThis->use_as____arm_2d_param_copy_orig_t); -#endif - - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t *pOriginMask = this.tOrigMask.pBuffer; - int_fast16_t iOrigMaskStride = this.tOrigMask.iStride; -#else - __API_INT_TYPE MaskColour = MASK_COLOR(__API_MTWM_INT_TYPE_BIT_NUM); -#endif - -#if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity += (hwOpacity == 255); -#endif - - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - float invIWidth = iWidth > 1 ? 1.0f / (float) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - regrCoefs); - - /* slopes between 1st and last cols */ - float slopeY, slopeX; - - slopeY = (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - - for (int_fast16_t x = 0; x < iWidth; x++) { - arm_2d_point_float_t tPoint; - - /* linear interpolation thru first & last cols */ - tPoint.fX = colFirstX + slopeX * x; - tPoint.fY = colFirstY + slopeY * x; - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__) - if (tPoint.fX > 0) { - tPoint.fX += __CALIB; - } else { - tPoint.fX -= __CALIB; - } - if (tPoint.fY > 0) { - tPoint.fY += __CALIB; - } else { - tPoint.fY -= __CALIB; - } - #endif - - __ARM_2D_FUNC(get_pixel_colour_mask)( - &tPoint, - &ptParam->tOrigin.tValidRegion, - ptParam->tOrigin.pBuffer, - iOrigStride, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - pOriginMask, - iOrigMaskStride, - #else - MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity, - #endif - pTargetBase - ); - pTargetBase++; - } - //phwSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - } -} - -#else /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - -static -void __MTWM_FUNC(get_pixel_colour_mask)(arm_2d_point_fx_t *ptFxPoint, - arm_2d_region_t *ptOrigValidRegion, - __API_INT_TYPE *pOrigin, - int16_t iOrigStride, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t *pchOrigMask, - int16_t iOrigMaskStride, - #else - __API_INT_TYPE MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - uint16_t hwOpacity, - #endif - __API_INT_TYPE *pTarget - ) -{ -#if __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - iOrigMaskStride *= 4; -#endif -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) \ - && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - - arm_2d_location_t tOriginLocation = { - .iX = ptFxPoint->X >> 16, - .iY = ptFxPoint->Y >> 16, - }; - - __arm_2d_point_adj_alpha_t tAdjacentArray - = __arm_2d_point_get_adjacent_alpha_q16(ptFxPoint); - - __API_PIXEL_AVERAGE_INIT(); - - //__API_INT_TYPE TempPixel; - bool bIsInside = false; - uint16_t hwTransparency = 0; - - for (int_fast8_t n = 0; n < 4; n++) { - uint16_t hwAlpha = tAdjacentArray.tMatrix[n].chAlpha; - - arm_2d_location_t tTemp = { - .iX = tOriginLocation.iX + tAdjacentArray.tMatrix[n].tOffset.iX, - .iY = tOriginLocation.iY + tAdjacentArray.tMatrix[n].tOffset.iY, - }; - //TempPixel = (*pTarget); - uint16_t hwPixelAlpha = 0; - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - - __API_INT_TYPE Temp = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - - #if __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX * 4]; - #else - hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX]; - #endif - - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwPixelAlpha = hwPixelAlpha * hwOpacity >> 8; - assert(hwOpacity != 255); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwPixelAlpha += (hwPixelAlpha == 255); - #endif - - hwPixelAlpha = hwPixelAlpha * hwAlpha >> 8; - - __API_MTWM_PIXEL_AVERAGE(Temp, hwPixelAlpha); - - bIsInside = true; - #else - if (Temp != MaskColour) { - bIsInside = true; - hwPixelAlpha = hwAlpha; - __API_MTWM_PIXEL_AVERAGE(Temp, hwAlpha); - } - #endif - } - - hwTransparency += hwAlpha - hwPixelAlpha; - } - - if (bIsInside) { - __API_MTWM_PIXEL_AVERAGE(*pTarget, hwTransparency); - - #if __API_MTWM_CFG_SUPPORT_OPACITY && !__API_MTWM_CFG_SUPPORT_SOURCE_MASK - __API_INT_TYPE tSourcPixel = __API_PIXEL_AVERAGE_RESULT(); - __API_MTWM_PIXEL_BLENDING( &tSourcPixel, pTarget, hwOpacity); - #else - *pTarget = __API_PIXEL_AVERAGE_RESULT(); - #endif - - } -#else - - arm_2d_location_t tTemp; - - tTemp.iX = ptFxPoint->X >> 16; - tTemp.iY = ptFxPoint->Y >> 16; - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - __API_INT_TYPE Temp = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - #if __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - uint16_t hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX * 4]; - #else - uint16_t hwPixelAlpha = pchOrigMask[tTemp.iY * iOrigMaskStride - + tTemp.iX]; - #endif - - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwPixelAlpha = hwPixelAlpha * hwOpacity >> 8; - assert(hwOpacity != 255); - #endif - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwPixelAlpha += (hwPixelAlpha == 255); - #endif - - __API_MTWM_PIXEL_BLENDING( &Temp, pTarget, hwPixelAlpha); - #else - - if (Temp != MaskColour) { - #if __API_MTWM_CFG_SUPPORT_OPACITY - __API_MTWM_PIXEL_BLENDING( &Temp, pTarget, hwOpacity); - #else - *pTarget = Temp; - #endif - } - #endif - } -#endif -} - -__WEAK -__WEAK -void __MTWM_FUNC(transform_with_mask)( - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_msk_t *ptThis, - #else - __arm_2d_param_copy_orig_t *ptParam, - #endif - __arm_2d_transform_info_t *ptInfo - #if __API_MTWM_CFG_SUPPORT_OPACITY - ,uint_fast16_t hwOpacity - #endif - ) -{ -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_t *ptParam = - &(ptThis->use_as____arm_2d_param_copy_orig_t); -#endif - - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t *pOriginMask = this.tOrigMask.pBuffer; - int_fast16_t iOrigMaskStride = this.tOrigMask.iStride; -#else - __API_INT_TYPE MaskColour = MASK_COLOR(__API_MTWM_INT_TYPE_BIT_NUM); -#endif - -#if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity += (hwOpacity == 255); -#endif - - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - q31_t invIWidth = iWidth > 1 ? 0x7fffffff / (iWidth - 1) : 0x7fffffff; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - regrCoefs); - - /* slopes between 1st and last cols */ - int32_t slopeY, slopeX; - - slopeY = - MULTFX((regrCoefs[1].interceptY - regrCoefs[0].interceptY), invIWidth); - slopeX = - MULTFX((regrCoefs[1].interceptX - regrCoefs[0].interceptX), invIWidth); - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - - for (int_fast16_t x = 0; x < iWidth; x++) { - arm_2d_point_fx_t tPointFast; - - tPointFast.X = __QDADD(colFirstX, slopeX * x); - tPointFast.Y = __QDADD(colFirstY, slopeY * x); - -#define __CALIBFX 590 - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__) - if (tPointFast.X > 0) { - tPointFast.X += __CALIBFX; - } else { - tPointFast.X -= __CALIBFX; - } - if (tPointFast.Y > 0) { - tPointFast.Y += __CALIBFX; - } else { - tPointFast.Y -= __CALIBFX; - } - #endif - - __ARM_2D_FUNC(get_pixel_colour_mask)( - &tPointFast, - &ptParam->tOrigin.tValidRegion, - pOrigin, - iOrigStride, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - pOriginMask, - iOrigMaskStride, - #else - MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity, - #endif - pTargetBase - ); - pTargetBase++; - } - //phwSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - } -} - -#endif /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - - - - -#undef get_pixel_colour_mask -#undef transform_with_mask - - -#undef __API_MTWM_COPY_LIKE_OP_NAME -#undef __API_MTWM_OP_NAME -#undef __API_MTWM_PIXEL_BLENDING -#undef ____MTWM_FUNC -#undef ___MTWM_FUNC -#undef __MTWM_FUNC -#undef __API_MTWM_COLOUR -#undef __API_MTWM_INT_TYPE -#undef __API_MTWM_INT_TYPE_BIT_NUM -#undef ____MTWM_TYPE -#undef ___MTWM_TYPE -#undef __MTWM_TYPE -#undef __API_MTWM_CFG_SUPPORT_SRC_MSK_WRAPING -#undef __API_MTWM_CFG_1_HORIZONTAL_LINE -#undef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT -#undef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -#undef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE -#undef __API_MTWM_PIXEL_AVERAGE -#undef __API_MTWM_PIXEL_AVERAGE_RESULT -#undef __API_MTWM_PIXEL_AVERAGE_INIT -#undef __API_MTWM_CFG_SUPPORT_SOURCE_MASK -#undef __API_MTWM_CFG_SUPPORT_TARGET_MASK -#undef __API_MTWM_CFG_SUPPORT_OPACITY diff --git a/package/Arm2D/Library/Source/__arm_2d_meta_trans_with_masks_helium.inc b/package/Arm2D/Library/Source/__arm_2d_meta_trans_with_masks_helium.inc deleted file mode 100644 index c01cdc8b5..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_meta_trans_with_masks_helium.inc +++ /dev/null @@ -1,1232 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_meta_trans_with_masks_helium.inc - * Description: c code template for : - * - transform_with_src_chn_mask_and_opacity - * - transform_with_src_mask_and_opacity - * - transform_with_src_chn_mask - * - transform_with_src_mask - * - * $Date: 12. July 2022 - * $Revision: V.1.0.4 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_MTWM_COLOUR -# error You have to define __API_MTWM_COLOUR before using this c template -#endif -#ifndef __API_MTWM_COLOUR_NAME -# error You have to define __API_MTWM_COLOUR_NAME before using this c template -#endif -#ifndef __API_MTWM_INT_TYPE -# error You have to define the __API_MTWM_INT_TYPE before using this c template -#endif -#ifndef __API_MTWM_INT_TYPE_BIT_NUM -# error You have to define the __API_MTWM_INT_TYPE_BIT_NUM before using this c template -#endif - - -/*! disable this feature by default */ -#ifndef __API_MTWM_CFG_SUPPORT_SRC_MSK_WRAPING -# define __API_MTWM_CFG_SUPPORT_SRC_MSK_WRAPING 0 -#endif - -//#ifndef __API_MTWM_CFG_1_HORIZONTAL_LINE -//# define __API_MTWM_CFG_1_HORIZONTAL_LINE 0 -//#endif - -//#ifndef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT -//# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT 0 -//#endif - -#ifndef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 0 -#endif - -//#ifndef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE -//# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE 0 -//#endif - -#ifndef __API_MTWM_CFG_SUPPORT_SOURCE_MASK -# define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 0 -#endif - -//#ifndef __API_MTWM_CFG_SUPPORT_TARGET_MASK -//# define __API_MTWM_CFG_SUPPORT_TARGET_MASK 0 -//#endif - -#ifndef __API_MTWM_CFG_SUPPORT_OPACITY -# define __API_MTWM_CFG_SUPPORT_OPACITY 0 -#endif - -#undef ____MTWM_FUNC -#undef ___MTWM_FUNC -#undef __MTWM_FUNC - - -#if __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE - #define MASK_STRIDE_SCALE 4 -#else - #define MASK_STRIDE_SCALE 1 -#endif - -#if __API_MTWM_CFG_SUPPORT_OPACITY - #define SCALE_BY_OPACITY(pixelAlpha, opa) vPixelAlpha = (vPixelAlpha * opa) >> 8; -#else - #define SCALE_BY_OPACITY(pixelAlpha, opa) -#endif - - -#ifndef __API_MTWM_OP_NAME -# define ____MTWM_FUNC(__NAME, __COLOUR) \ - __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__NAME) -# define ___MTWM_FUNC(__NAME, __COLOUR) ____MTWM_FUNC(__NAME, __COLOUR) -#else -# define _____MTWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__OP_NAME##_##__NAME) -# define ____MTWM_FUNC(__OP_NAME, __NAME, __COLOUR) \ - _____MTWM_FUNC(__OP_NAME, __NAME, __COLOUR) -# define ___MTWM_FUNC(__NAME, __COLOUR) \ - ____MTWM_FUNC(__API_MTWM_OP_NAME, __NAME, __COLOUR) -#endif - -#define __MTWM_FUNC(__NAME) ___MTWM_FUNC(__NAME, __API_MTWM_COLOUR_NAME) - - -#undef ____MTWM_TYPE -#undef ___MTWM_TYPE -#undef __MTWM_TYPE - -#ifndef __API_MTWM_OP_NAME -# define ____MTWM_TYPE(__NAME, __COLOUR) arm_2d_##__COLOUR##_##__NAME -# define ___MTWM_TYPE(__NAME, __COLOUR) ____MTWM_TYPE(__NAME, __COLOUR) -#else -# define _____MTWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - arm_2d_##__COLOUR##_##__OP_NAME##_##__NAME -# define ____MTWM_TYPE(__OP_NAME, __NAME, __COLOUR) \ - _____MTWM_TYPE(__OP_NAME, __NAME, __COLOUR) -# define ___MTWM_TYPE(__NAME, __COLOUR) \ - ____MTWM_TYPE(__API_MTWM_OP_NAME, __NAME, __COLOUR) -#endif - - -#define __MTWM_TYPE(__NAME) ___MTWM_TYPE(__NAME, __API_MTWM_COLOUR) - -/*============================ PROTOTYPES ====================================*/ -extern -void __MTWM_FUNC(transform_with_mask)( - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_msk_t *ptThis, - #else - __arm_2d_param_copy_orig_t *ptParam, - #endif - __arm_2d_transform_info_t *ptInfo - #if __API_MTWM_CFG_SUPPORT_OPACITY - ,uint_fast16_t hwOpacity - #endif - ); - -/*============================ IMPLEMENTATION ================================*/ - - -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - -/** - Scale Gray8 pixel vector with Area & Alpha - */ -#define __ARM_2D_SCALE_MASK_GRAY8VEC(/* outputs */ \ - vAvgPix, vTransp, \ - /* inputs */ \ - vPtVal, vAreaScal, vAlphaSc) \ - float16x8_t vAlpha = vAreaScal * vcvtq_f16_u16(vAlphaSc) ; \ - vTransp = 256.0f16 * vAreaScal - vAlpha; \ - vAvgPix = vAlpha * vcvtq_f16_u16(vPtVal); - -/** - Scale Gray8 pixel vector with Area & Alpha. Accumulated version - */ -#define __ARM_2D_SCALE_MASK_GRAY8VEC_ACC(/* input / outputs */ \ - vAvgPix, vTransp, \ - /* inputs */ \ - vPtVal, vAreaScal, vAlphaSc) \ - float16x8_t vAlpha = vAreaScal * vcvtq_f16_u16(vAlphaSc); \ - vTransp += 256.0f16 * vAreaScal - vAlpha; \ - vAvgPix += vAlpha * vcvtq_f16_u16(vPtVal); - - -/** - Scale R/G/B pixel vectors with Area & Alpha - */ -#define __ARM_2D_SCALE_MASK_RGBVEC(/* outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency, \ - /* inputs */ \ - R, G, B, vScal, vAlphaSc) \ - float16x8_t vAlpha = vScal * vcvtq_f16_u16(vAlphaSc) ; \ - vAvgTransparency = 256.0f16 * vScal - vAlpha; \ - vAvgPixelR = vAlpha * vcvtq_f16_u16(R); \ - vAvgPixelG = vAlpha * vcvtq_f16_u16(G); \ - vAvgPixelB = vAlpha * vcvtq_f16_u16(B); - - -/** - Scale R/G/B pixel vectors with Area & Alpha. Accumulated version - */ -#define __ARM_2D_SCALE_MASK_RGBVEC_ACC(/* input / outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB,vAvgTransparency, \ - /* inputs */ \ - R, G, B, vScal, vAlphaSc) \ - float16x8_t vAlpha = vScal * vcvtq_f16_u16(vAlphaSc) ; \ - vAvgTransparency += 256.0f16 * vScal - vAlpha; \ - vAvgPixelR += vAlpha * vcvtq_f16_u16(R); \ - vAvgPixelG += vAlpha * vcvtq_f16_u16(G); \ - vAvgPixelB += vAlpha * vcvtq_f16_u16(B); - - -/** - Mix Gray8 averaged pixel vector with transparency-scaled target vector - */ -#define __ARM_2D_BLEND_AVG_TARGET_GRAY8(vAvgPixel, vTarget, vAvgTransparency) \ - vqaddq(vcvtq_u16_f16(vAvgPixel), \ - vcvtq_u16_f16(vAvgTransparency) * vTarget) >> 8; - -/** - Mix R, G, B averaged pixel vectors with transparency-scaled target vector - */ -#define __ARM_2D_BLEND_AVG_TARGET_RGB(/* input / outputs */ \ - vAvgR, vAvgG, vAvgB, \ - /* inputs */ \ - vTargetR, vTargetG, vTargetB, vAvgTrans) \ - vAvgR = vqaddq(vAvgR, vTargetR * vAvgTrans); \ - vAvgR = vAvgR >> 8; \ - \ - vAvgG = vqaddq(vAvgG, vTargetG * vAvgTrans); \ - vAvgG = vAvgG >> 8; \ - \ - vAvgB = vqaddq(vAvgB, vTargetB * vAvgTrans); \ - vAvgB = vAvgB >> 8; - - -#else /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - - -/** - Scale Gray8 pixel vector with Area & Alpha - */ -#define __ARM_2D_SCALE_MASK_GRAY8VEC(/* outputs */ \ - vAvgPix, vTransp, \ - /* inputs */ \ - vPtVal, vAreaScal, vAlphaSc) \ - uint16x8_t vAlpha = vmulq_u16((vAreaScal >> 8), vAlphaSc); \ - vTransp = vAreaScal - vAlpha; \ - vAvgPix = vrmulhq(vAlpha, vPtVal); - -/** - Scale Gray8 pixel vector with Area & Alpha. Accumulated version - */ -#define __ARM_2D_SCALE_MASK_GRAY8VEC_ACC(/* input / outputs */ \ - vAvgPix, vTransp, \ - /* inputs */ \ - vPtVal, vAreaScal, vAlphaSc) \ - uint16x8_t vAlpha = vmulq_u16((vAreaScal >> 8), vAlphaSc); \ - vTransp = vqaddq(vTransp, vAreaScal - vAlpha); \ - vAvgPix = vqaddq(vAvgPix, vrmulhq(vAlpha, vPtVal)); - -/** - Scale R/G/B pixel vectors with Area & Alpha - */ -#define __ARM_2D_SCALE_MASK_RGBVEC(/* outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency, \ - /* inputs */ \ - R, G, B, vScal, vAlphaSc) \ - uint16x8_t vAlpha = vmulq_u16((vScal >> 8), vAlphaSc); \ - vAvgTransparency = vScal - vAlpha; \ - vAvgPixelR = vrmulhq_u16(vAlpha, R ); \ - vAvgPixelG = vrmulhq_u16(vAlpha, G ); \ - vAvgPixelB = vrmulhq_u16(vAlpha, B ); - - -/** - Scale R/G/B pixel vectors with Area & Alpha. Accumulated version - */ -#define __ARM_2D_SCALE_MASK_RGBVEC_ACC(/* input / outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB,vAvgTransparency, \ - /* inputs */ \ - R, G, B, vScal, vAlphaSc) \ - uint16x8_t vAlpha = vmulq_u16((vScal >> 8), vAlphaSc); \ - vAvgTransparency = vqaddq(vAvgTransparency, vScal - vAlpha); \ - vAvgPixelR = vqaddq(vAvgPixelR, vrmulhq_u16(vAlpha, R)); \ - vAvgPixelG = vqaddq(vAvgPixelG, vrmulhq_u16(vAlpha, G)); \ - vAvgPixelB = vqaddq(vAvgPixelB, vrmulhq_u16(vAlpha, B)); - - -/** - Mix Gray8 averaged pixel vector with transparency-scaled target vector - */ -#define __ARM_2D_BLEND_AVG_TARGET_GRAY8(vAvgPixel, vTarget, vAvgTransparency) \ - vminq(vAvgPixel + vrmulhq(vTarget, vAvgTransparency), vdupq_n_u16(255)); - - -/** - Mix R, G, B averaged pixel vectors with transparency-scaled target vector - */ -#define __ARM_2D_BLEND_AVG_TARGET_RGB(/* inputs / outputs */ \ - vAvgR, vAvgG, vAvgB, \ - /* inputs */ \ - vTargetR, vTargetG, vTargetB, vAvgTrans) \ - vAvgR = vqaddq(vAvgR, vrmulhq(vTargetR, vAvgTrans)); \ - vAvgR = vminq(vAvgR, vdupq_n_u16(255)); \ - \ - vAvgG = vqaddq(vAvgG, vrmulhq(vTargetG, vAvgTrans)); \ - vAvgG = vminq(vAvgG, vdupq_n_u16(255)); \ - \ - vAvgB = vqaddq(vAvgB, vrmulhq(vTargetB, vAvgTrans)); \ - vAvgB = vminq(vAvgB, vdupq_n_u16(255)); - -#endif - -#if __API_MTWM_COLOUR == ARM_2D_M_COLOUR_GRAY8 - -/** - Unpack vectors of 8-bit widened pixels read from a input 2D coordinates if fits inside the region of - interest - Unpack vectors of 8-bit widened masks (alpha) read from a input 2D coordinates if fits inside the region of - interest. Masks indexes are scaled based on input stride and exta scale for src chan. mask operarations - Vector mask content is further scaled using input opacity - Update global predictor tracking region fit & color mask comparison. - */ - -#define __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_ARR_FAR(/* inputs */ \ - vecX, vecY, \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStrd, maskScal, \ - opacity, predTail, \ - /* outputs */ \ - vPixVal, vPixelAlpha, \ - predGlb) \ - arm_2d_point_s16x8_t vPoint = {.X = vecX,.Y = vecY }; \ - /* set vector predicate if point is inside the region */ \ - mve_pred16_t p = \ - arm_2d_is_point_vec_inside_region_s16(ptOrigValidRegion, &vPoint); \ - predGlb |= p; \ - /* prepare vector of point offsets */ \ - int16_t correctionOffset = vminvq_s16(INT16_MAX, vPoint.Y) - 1; \ - uint16x8_t ptOffs = vPoint.X + (vPoint.Y - correctionOffset) * iOrigStride; \ - \ - /* base pointer update to compensate offset */ \ - uint8_t *pOriginCorrected = pOrigin + (correctionOffset * iOrigStride); \ - /* retrieve all point values */ \ - vPixVal = \ - vldrbq_gather_offset_z_u16(pOriginCorrected, ptOffs, predTail & p); \ - \ - uint16x8_t maskOffs = maskScal * vPoint.X + (vPoint.Y - correctionOffset) * maskStrd; \ - uint8_t *pMaskCorrected = pMaskArr + (correctionOffset * maskStrd); \ - /* retrieve all mask values */ \ - vPixelAlpha = \ - vldrbq_gather_offset_z_u16(pMaskCorrected, maskOffs, predTail & p); \ - \ - SCALE_BY_OPACITY(vPixelAlpha, opacity); \ - \ - ALPHA_255_COMP_VEC16(vPixelAlpha, 255); - - - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - -/* Compute averaged gray8 pixel 8-bit widenedvector and tranparency using 4 neighbouring pixel / masks */ -/* Return predictors if vectors fit region of interest */ -#define __ARM2D_AVG_NEIGHBR_GRAY8_PIX_MASK_ARR(/* inputs */ \ - ptPoint, vXi, vYi, \ - Origin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, \ - vTarget, opacity, predTail, \ - /* outputs */ \ - predGlb, vAvgPixel, vAvgTransparency) \ - \ - uint16x8_t ptVal8, vPixelAlpha; \ - /* combination of Bottom / Top & Left / Right areas contributions */ \ - __typeof__ (vAvgPixel) vAreaTR, vAreaTL, vAreaBR, vAreaBL; \ - \ - __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, vAreaTR, vAreaTL, vAreaBR, vAreaBL); \ - \ - /* \ - * accumulate / average over the 4 neigbouring pixels \ - */ \ - \ - /* Bottom Left averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_ARR_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, \ - iOrigStride, pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTail, \ - ptVal8, vPixelAlpha, predGlb); \ - \ - __ARM_2D_SCALE_MASK_GRAY8VEC(vAvgPixel, vAvgTransparency, ptVal8, vAreaBL, vPixelAlpha); \ - } \ - \ - /* Bottom Right averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_ARR_FAR(vaddq_n_s16(vXi, 1), vYi, pOrigin, \ - ptOrigValidRegion, iOrigStride, pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTail, ptVal8, vPixelAlpha, predGlb); \ - \ - __ARM_2D_SCALE_MASK_GRAY8VEC_ACC(vAvgPixel, vAvgTransparency, ptVal8, vAreaBR, vPixelAlpha); \ - } \ - \ - /* Top Left averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_ARR_FAR(vXi, vaddq_n_s16(vYi, 1), pOrigin, \ - ptOrigValidRegion, iOrigStride, pMaskArr,maskStride, MASK_STRIDE_SCALE, \ - opacity, predTail, \ - ptVal8, vPixelAlpha, predGlb); \ - \ - __ARM_2D_SCALE_MASK_GRAY8VEC_ACC(vAvgPixel, vAvgTransparency, ptVal8, vAreaTL, vPixelAlpha); \ - } \ - \ - /* Top Right averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_ARR_FAR(vaddq_n_s16(vXi, 1), vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTail,ptVal8, vPixelAlpha, predGlb); \ - \ - __ARM_2D_SCALE_MASK_GRAY8VEC_ACC(vAvgPixel, vAvgTransparency, ptVal8, vAreaTR, vPixelAlpha); \ - } - -#endif - - -#elif __API_MTWM_COLOUR == ARM_2D_M_COLOUR_RGB565 - -/** - Unpack vectors of 8-bit widened R, G and B pixels read from a input 2D coordinates if fits inside the region of - interest - Unpack vectors of 8-bit widened masks (alpha) read from a input 2D coordinates if fits inside the region of - interest. Masks indexes are scaled based on input stride and exta scale for src chan. mask operarations - Vector mask content is further scaled using input opacity - Update global predictor tracking region fit & color mask comparison. - */ -#define __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_MASK_ARRR_FAR(/* inputs */ \ - vecX, vecY, pOrigin, \ - ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStrd, maskScal, \ - opacity, predTail, \ - /* outputs */ \ - R, G, B, \ - vPixelAlpha, pGlb) \ - arm_2d_point_s16x8_t vPoint = {.X = vecX,.Y = vecY }; \ - /* set vector predicate if point is inside the region */ \ - mve_pred16_t p = \ - arm_2d_is_point_vec_inside_region_s16(ptOrigValidRegion, &vPoint); \ - pGlb |= p; \ - /* prepare vector of point offsets */ \ - int16_t correctionOffset = vminvq_s16(INT16_MAX, vPoint.Y) - 1; \ - uint16x8_t ptOffs = vPoint.X + (vPoint.Y - correctionOffset) * iOrigStride; \ - \ - /* base pointer update to compensate offset */ \ - uint16_t *pOriginCorrected = pOrigin + (correctionOffset * iOrigStride); \ - /* retrieve all point values */ \ - uint16x8_t ptVal = \ - vldrhq_gather_shifted_offset_z_u16(pOriginCorrected, ptOffs, predTail & p); \ - \ - /* expand channels */ \ - __arm_2d_rgb565_unpack_single_vec(ptVal, &R, &G, &B); \ - uint16x8_t maskOffs = maskScal * vPoint.X + (vPoint.Y - correctionOffset) * maskStrd; \ - uint8_t *pMaskCorrected = pMaskArr + (correctionOffset * maskStrd); \ - /* retrieve all mask values */ \ - vPixelAlpha = \ - vldrbq_gather_offset_z_u16(pMaskCorrected, maskOffs, predTail & p); \ - \ - SCALE_BY_OPACITY(vPixelAlpha, opacity); \ - \ - ALPHA_255_COMP_VEC16(vPixelAlpha, 255); - - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - -/* Computes averaged R, G, B 8-bit widened pixels vector and tranparency using 4 neighbouring pixel / masks */ -/* Returns predictor if vectors fit region of interest */ -#define __ARM2D_AVG_NEIGHBR_RGB565_PIX_MASK_ARR(ptPoint, vXi, vYi, \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, vTarget, \ - opacity, predTail, \ - /* outputs */ \ - predGlb, \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - vAvgTransparency) \ - \ - uint16x8_t R, G, B, vPixelAlpha; \ - /* combination of Bottom / Top & Left / Right areas contributions */ \ - __typeof__ (vAvgPixelR) vAreaTR, vAreaTL, vAreaBR, vAreaBL; \ - \ - __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, vAreaTR, vAreaTL, vAreaBR, vAreaBL); \ - \ - \ - /* Bottom Left averaging */ \ - { \ - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_MASK_ARRR_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, \ - iOrigStride, \ - pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTail, \ - R, G, B, vPixelAlpha, predGlb); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC(vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency, R, \ - G, B, vAreaBL, vPixelAlpha); \ - } \ - \ - \ - /* Bottom Right averaging */ \ - { \ - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_MASK_ARRR_FAR(vaddq_n_s16(vXi, 1), vYi, \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr,maskStride, MASK_STRIDE_SCALE, \ - opacity, predTail, \ - R, G, B, vPixelAlpha, \ - predGlb); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - vAvgTransparency, R, G, B, vAreaBR, vPixelAlpha); \ - } \ - \ - /* Top Left averaging */ \ - { \ - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_MASK_ARRR_FAR(vXi, vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTail, \ - R, G, B, vPixelAlpha, predGlb); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - vAvgTransparency, R, G, B, vAreaTL, vPixelAlpha); \ - } \ - \ - /* Top Right averaging */ \ - { \ - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_MASK_ARRR_FAR(vaddq_n_s16(vXi, 1), vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity,predTail, \ - R, G, B, vPixelAlpha, predGlb); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - vAvgTransparency, R, G, B, vAreaTR, vPixelAlpha); \ - } -#endif - - -#elif __API_MTWM_COLOUR == ARM_2D_M_COLOUR_CCCN888 - -/** - Unpack vectors of 8-bit widened R, G and B pixels read from a input 2D coordinates if fits inside the region of - interest. These are read from 2 adjacent 32-bit packed vectors hence 2 tail prediction masks are needed - Unpack vectors of 8-bit widened masks (alpha) read from a input 2D coordinates if fits inside the region of - interest. Masks indexes are scaled based on input stride and exta scale for src chan. mask operarations - Vector mask content is further scaled using input opacity - Update 2 global predictors tracking region fit for 1st and 2nd 32-bit vector. - */ - -#define __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_MASK_ARR(/* inputs */ \ - vecX, vecY, \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStrd, maskScal, opacity, \ - predTailLow, predTailHigh, \ - /* outputs */ \ - R, G, B, vPixelAlpha, pGlbLo, pGlbHi) \ - arm_2d_point_s16x8_t vPoint = {.X = vecX,.Y = vecY }; \ - arm_2d_point_s32x4_t tPointLo, tPointHi; \ - \ - /* split 16-bit point vector into 2 x 32-bit vectors */ \ - vst1q(pscratch16, vPoint.X); \ - tPointLo.X = vldrhq_s32(pscratch16); \ - tPointHi.X = vldrhq_s32(pscratch16 + 4); \ - \ - vst1q(pscratch16, vPoint.Y); \ - tPointLo.Y = vldrhq_s32(pscratch16); \ - tPointHi.Y = vldrhq_s32(pscratch16 + 4); \ - \ - /* 1st half */ \ - \ - /* set vector predicate if point is inside the region */ \ - mve_pred16_t p = arm_2d_is_point_vec_inside_region_s32(ptOrigValidRegion, &tPointLo); \ - pGlbLo |= p; \ - /* prepare vector of point offsets */ \ - uint32x4_t ptOffs = tPointLo.X + tPointLo.Y * iOrigStride; \ - \ - /* retrieve all point values */ \ - uint32x4_t ptVal = vldrwq_gather_shifted_offset_z_u32(pOrigin, ptOffs, predTailLow & p); \ - \ - vst1q(scratch32, ptVal); \ - \ - uint32x4_t maskOffs = maskScal * tPointLo.X + tPointLo.Y * maskStrd; \ - uint32x4_t maskVal = \ - vldrbq_gather_offset_z_u32(pMaskArr, maskOffs, predTailLow & p); \ - \ - vst1q(scratch32+8, maskVal); \ - \ - /* 2nd half */ \ - \ - /* set vector predicate if point is inside the region */ \ - p = arm_2d_is_point_vec_inside_region_s32(ptOrigValidRegion, &tPointHi); \ - pGlbHi |= p; \ - /* prepare vector of point offsets */ \ - ptOffs = tPointHi.X + tPointHi.Y * iOrigStride; \ - \ - /* retrieve all point values */ \ - ptVal = vldrwq_gather_shifted_offset_z_u32(pOrigin, ptOffs, predTailHigh & p); \ - \ - vst1q(scratch32 + 4, ptVal); \ - \ - maskOffs = maskScal * tPointHi.X + tPointHi.Y * maskStrd; \ - maskVal = \ - vldrbq_gather_offset_z_u32(pMaskArr, maskOffs, predTailHigh & p); \ - \ - vst1q(scratch32+12, maskVal); \ - \ - /* expand channels */ \ - __arm_2d_unpack_rgb888_from_mem((uint8_t *) scratch32, &R, &G, &B); \ - \ - vPixelAlpha = vldrbq_gather_offset_u16((uint8_t *) &scratch32[8], vidupq_n_u16(0, 4)); \ - \ - SCALE_BY_OPACITY(vPixelAlpha, opacity); \ - \ - ALPHA_255_COMP_VEC16(vPixelAlpha, 255); - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - -/* compute averaged R, G, B 8-bit widened pixels vector and tranparency using 4 neighbouring pixel / masks */ -/* Returns 2 predictors for top / bottom 32-bit vectors fitting region of interest */ -#define __ARM2D_AVG_NEIGHBR_RGB888_PIX_MASK_ARR(ptPoint, vXi, vYi, \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, vTarget, opacity, \ - predTail, \ - /* outputs */ \ - predGlbLo, predGlbHi, \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency)\ - \ - uint16x8_t R, G, B, vPixelAlpha; \ - /* combination of Bottom / Top & Left / Right areas contributions */ \ - __typeof__ (vAvgPixelR) vAreaTR, vAreaTL, vAreaBR, vAreaBL; \ - \ - __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, vAreaTR, vAreaTL, vAreaBR, vAreaBL); \ - \ - /* \ - * accumulate / average over the 4 neigbouring pixels \ - */ \ - \ - \ - /* Bottom Left averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_MASK_ARR(vXi, vYi, pOrigin, ptOrigValidRegion, \ - iOrigStride, pMaskArr, \ - maskStride, MASK_STRIDE_SCALE, opacity, \ - predTailLow, predTailHigh, \ - R, G, B, vPixelAlpha, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC(vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency, R, \ - G, B, vAreaBL, vPixelAlpha); \ - } \ - \ - /* Bottom Right averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_MASK_ARR(vaddq_n_s16(vXi, 1), vYi, \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTailLow, predTailHigh, \ - R, G, B, vPixelAlpha, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - vAvgTransparency, R, G, B, vAreaBR, vPixelAlpha); \ - } \ - \ - /* Top Left averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_MASK_ARR(vXi, vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTailLow, predTailHigh, \ - R, G, B, vPixelAlpha, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - vAvgTransparency, R, G, B, vAreaTL, vPixelAlpha) \ - } \ - \ - /* Top Right averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_MASK_ARR(vaddq_n_s16(vXi, 1), vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, \ - pMaskArr, maskStride, MASK_STRIDE_SCALE, \ - opacity, predTailLow, predTailHigh, \ - R, G, B, vPixelAlpha, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_MASK_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - vAvgTransparency, R, G, B, vAreaTR, vPixelAlpha) \ - } - -#endif - -#endif - - -#if __API_MTWM_COLOUR == ARM_2D_M_COLOUR_GRAY8 - -static -void __MVE_WRAPPER(ARM_CONNECT2(__arm_2d_impl_gray8_, get_pixel_colour_mask)) ( - ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint8_t * pOrigin, int16_t iOrigStride, - uint8_t * pTarget, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t * pchOrigMask, int16_t iOrigmaskStride, - #else - __API_INT_TYPE MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - uint16_t hwOpacity, - #endif - uint32_t elts) -{ - iOrigmaskStride *= MASK_STRIDE_SCALE; - - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vldrbq_u16(pTarget); - - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixel; - - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - PIX_VEC_TYP vAvgTransparency; - - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - __ARM2D_AVG_NEIGHBR_GRAY8_PIX_MASK_ARR(ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, pchOrigMask, iOrigmaskStride, vTarget, - hwOpacity, predTail, - predGlb, vAvgPixel, vAvgTransparency); - } -#else - { - uint16x8_t ptVal8, vPixelAlpha; - - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_ARR_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, pchOrigMask, iOrigmaskStride, - MASK_STRIDE_SCALE, hwOpacity, predTail, - ptVal8, vPixelAlpha, predGlb); - - __ARM_2D_SCALE_MASK_GRAY8VEC(vAvgPixel, vAvgTransparency, ptVal8, AREA_UNITY, vPixelAlpha); - - } -#endif - - /* blending */ - uint16x8_t vBlended = __ARM_2D_BLEND_AVG_TARGET_GRAY8(vAvgPixel, vTarget, vAvgTransparency); - - /* select between target pixel, averaged pixed */ - vTarget = vpselq_u16(vBlended, vTarget, predGlb); - - vstrbq_p_u16(pTarget, vTarget, predTail); -} - -#elif __API_MTWM_COLOUR == ARM_2D_M_COLOUR_RGB565 - -static -void __MVE_WRAPPER(ARM_CONNECT2(__arm_2d_impl_rgb565_, get_pixel_colour_mask))(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint16_t * pOrigin, - int16_t iOrigStride, - uint16_t * pTarget, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t * pchOrigMask, - int16_t iOrigmaskStride, - #else - __API_INT_TYPE MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - uint16_t hwOpacity, - #endif - uint32_t elts) -{ - iOrigmaskStride *= MASK_STRIDE_SCALE; - - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vld1q(pTarget); - PIX_VEC_TYP vAvgTransparency; - - - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - uint16x8_t vAvgR, vAvgG, vAvgB, vAvgTrans; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - - __ARM2D_AVG_NEIGHBR_RGB565_PIX_MASK_ARR(ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, pchOrigMask, iOrigmaskStride, vTarget, - hwOpacity, predTail, predGlb, vAvgPixelR, - vAvgPixelG, vAvgPixelB, vAvgTransparency); - -#else - { - uint16x8_t R, G, B, vPixelAlpha; - - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_MASK_ARRR_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - pchOrigMask, - iOrigmaskStride, MASK_STRIDE_SCALE, - hwOpacity, predTail, R, G, B, - vPixelAlpha, predGlb); - - __ARM_2D_SCALE_MASK_RGBVEC(vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency, R, - G, B, AREA_UNITY, vPixelAlpha); - } -#endif - - vAvgR = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR); - vAvgG = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG); - vAvgB = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB); - vAvgTrans = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgTransparency); - - /* blending */ - uint16x8_t vBlended; - uint16x8_t vTargetR, vTargetG, vTargetB; - - __arm_2d_rgb565_unpack_single_vec(vTarget, &vTargetR, &vTargetG, &vTargetB); - - /* merge */ - __ARM_2D_BLEND_AVG_TARGET_RGB(vAvgR, vAvgG, vAvgB, vTargetR, vTargetG, vTargetB, vAvgTrans); - - vBlended = __arm_2d_rgb565_pack_single_vec(vAvgR, vAvgG, vAvgB); - - /* select between target pixel, averaged pixed */ - vTarget = vpselq_u16(vBlended, vTarget, predGlb); - - vst1q_p(pTarget, vTarget, predTail); -} - - -#elif __API_MTWM_COLOUR == ARM_2D_M_COLOUR_CCCN888 - - -static -void __MVE_WRAPPER(ARM_CONNECT2(__arm_2d_impl_cccn888_, get_pixel_colour_mask))(ARM_2D_POINT_VEC *ptPoint, - arm_2d_region_t *ptOrigValidRegion, - uint32_t *pOrigin, - int16_t iOrigStride, - uint32_t *pTarget, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t * pchOrigMask, - int16_t iOrigmaskStride, - #else - __API_INT_TYPE MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - uint16_t hwOpacity, - #endif - uint32_t elts - ) -{ - iOrigmaskStride *= MASK_STRIDE_SCALE; - - ARM_ALIGN(8) uint32_t scratch32[32]; - int16_t *pscratch16 = (int16_t *) scratch32; - uint32x4_t vTargetLo = vld1q(pTarget); - uint32x4_t vTargetHi = vld1q(pTarget + 4); - mve_pred16_t predTailLow = vctp32q(elts); - mve_pred16_t predTailHigh = elts - 4 > 0 ? vctp32q(elts - 4) : 0; - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - - /* predicate accumulators */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlbLo = 0, predGlbHi = 0; - PIX_VEC_TYP vAvgTransparency; - uint16x8_t vAvgR, vAvgG, vAvgB, vAvgTrans; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - /* - * accumulate / average over the 4 neigbouring pixels - */ - __ARM2D_AVG_NEIGHBR_RGB888_PIX_MASK_ARR(ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, pchOrigMask, iOrigmaskStride, vTarget, - hwOpacity, predTail, predGlbLo, predGlbHi, - vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency); -#else - { - uint16x8_t R, G, B, vPixelAlpha; - - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_MASK_ARR(vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, pchOrigMask, - iOrigmaskStride, MASK_STRIDE_SCALE, - hwOpacity, predTailLow, predTailHigh, - R, G, B, vPixelAlpha, predGlbLo, predGlbHi); - - __ARM_2D_SCALE_MASK_RGBVEC(vAvgPixelR, vAvgPixelG, vAvgPixelB, vAvgTransparency, R, - G, B, AREA_UNITY, vPixelAlpha); - } -#endif - - vAvgR = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR); - vAvgG = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG); - vAvgB = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB); - vAvgTrans = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgTransparency); - - /* alpha blending */ - uint16x8_t vTargetR, vTargetG, vTargetB; - - __arm_2d_unpack_rgb888_from_mem((const uint8_t *) pTarget, &vTargetR, &vTargetG, &vTargetB); - - - /* merge */ - __ARM_2D_BLEND_AVG_TARGET_RGB(vAvgR, vAvgG, vAvgB, vTargetR, vTargetG, vTargetB, vAvgTrans); - - /* pack */ - __arm_2d_pack_rgb888_to_mem((uint8_t *) scratch32, vAvgR, vAvgG, vAvgB); - - uint32x4_t TempPixel = vld1q(scratch32); - - /* select between target pixel, averaged pixed */ - TempPixel = vpselq_u32(TempPixel, vTargetLo, predGlbLo); - - vst1q_p(pTarget, TempPixel, predTailLow); - - TempPixel = vld1q(scratch32 + 4); - - /* select between target pixel, averaged pixed */ - TempPixel = vpselq_u32(TempPixel, vTargetHi, predGlbHi); - - vst1q_p(pTarget + 4, TempPixel, predTailHigh); -} - - - -#endif - - - -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - - - -__OVERRIDE_WEAK -void __MTWM_FUNC(transform_with_mask)( - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_msk_t *ptThis, - #else - __arm_2d_param_copy_orig_t *ptParam, - #endif - __arm_2d_transform_info_t *ptInfo - #if __API_MTWM_CFG_SUPPORT_OPACITY - ,uint_fast16_t hwOpacity - #endif - ) -{ - -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_t *ptParam = - &(ptThis->use_as____arm_2d_param_copy_orig_t); -#endif - - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t *pOriginMask = this.tOrigMask.pBuffer; - int_fast16_t iOrigMaskStride = this.tOrigMask.iStride; -#else - __API_INT_TYPE MaskColour = ptInfo->Mask.hwColour; -#endif - -#if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity += (hwOpacity == 255); -#endif - - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - float invIWidth = iWidth > 1 ? 1.0f / (float) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - iOrigStride, - regrCoefs); - - /* slopes between 1st and last cols */ - float slopeY, slopeX; - - slopeY = (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - - __ARM_2D_FUNC(get_pixel_colour_mask)( - &tPointV, - &ptParam->tOrigin.tValidRegion, - ptParam->tOrigin.pBuffer, - iOrigStride, - pTargetBaseCur, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - pOriginMask, - iOrigMaskStride, - #else - MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity, - #endif - nbVecElts - ); - - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += (iTargetStride); - } -} - - -#else /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - - -__OVERRIDE_WEAK -void __MTWM_FUNC(transform_with_mask)( - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_msk_t *ptThis, - #else - __arm_2d_param_copy_orig_t *ptParam, - #endif - __arm_2d_transform_info_t *ptInfo - #if __API_MTWM_CFG_SUPPORT_OPACITY - ,uint_fast16_t hwOpacity - #endif - ) -{ -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK \ - || __API_MTWM_CFG_SUPPORT_TARGET_MASK - __arm_2d_param_copy_orig_t *ptParam = - &(ptThis->use_as____arm_2d_param_copy_orig_t); -#endif - - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - -#if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - uint8_t *pOriginMask = this.tOrigMask.pBuffer; - int_fast16_t iOrigMaskStride = this.tOrigMask.iStride; -#else - __API_INT_TYPE MaskColour = ptInfo->Mask.hwColour; -#endif - -#if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity += (hwOpacity == 255); -#endif - - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - q31_t invIWidth = iWidth > 1 ? 0x7fffffff / (iWidth - 1) : 0x7fffffff; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - iOrigStride, - regrCoefs); - - - /* slopes between 1st and last cols */ - int32_t slopeY, slopeX; - - slopeY = - MULTFX((regrCoefs[1].interceptY - regrCoefs[0].interceptY), invIWidth); - slopeX = - MULTFX((regrCoefs[1].interceptX - regrCoefs[0].interceptX), invIWidth); - - int32_t nrmSlopeX = 17 - __CLZ(ABS(slopeX)); - int32_t nrmSlopeY = 17 - __CLZ(ABS(slopeY)); - - slopeX = ARSHIFT(slopeX, nrmSlopeX); - slopeY = ARSHIFT(slopeY, nrmSlopeY); - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - /* Q6 conversion */ - colFirstX = colFirstX >> 10; - colFirstY = colFirstY >> 10; - - int32_t nbVecElts = iWidth; - int16x8_t vX = (int16x8_t) vidupq_n_u16(0, 1); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - /* Q9.6 coversion */ - vX = SET_Q6INT(vX); - - while (nbVecElts > 0) { - arm_2d_point_s16x8_t tPointV; - - tPointV.X = vqdmulhq_n_s16(vX, slopeX); - tPointV.X = vaddq_n_s16(vqrshlq_n_s16(tPointV.X, nrmSlopeX), colFirstX); - - tPointV.Y = vqdmulhq_n_s16(vX, slopeY); - tPointV.Y = vaddq_n_s16(vqrshlq_n_s16(tPointV.Y, nrmSlopeY), colFirstY); - - - - __ARM_2D_FUNC(get_pixel_colour_mask)( - &tPointV, - &ptParam->tOrigin.tValidRegion, - ptParam->tOrigin.pBuffer, - iOrigStride, - pTargetBaseCur, - #if __API_MTWM_CFG_SUPPORT_SOURCE_MASK - pOriginMask, - iOrigMaskStride, - #else - MaskColour, - #endif - #if __API_MTWM_CFG_SUPPORT_OPACITY - hwOpacity, - #endif - nbVecElts - ); - - pTargetBaseCur += 8; - vX += SET_Q6INT(8); - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -} - - - -#endif /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - - - - -#undef get_pixel_colour_mask -#undef transform_with_mask -#undef MASK_STRIDE_SCALE -#undef SCALE_BY_OPACITY - -#undef __ARM2D_AVG_NEIGHBR_GRAY8_PIX_MASK_ARR -#undef __ARM2D_AVG_NEIGHBR_RGB565_PIX_MASK_ARR -#undef __ARM2D_AVG_NEIGHBR_RGB888_PIX_MASK_ARR - - -#undef __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_ARR_FAR -#undef __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_MASK_ARRR_FAR -#undef __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_MASK_ARR - -#undef __ARM_2D_SCALE_MASK_GRAY8VEC -#undef __ARM_2D_SCALE_MASK_GRAY8VEC_ACC -#undef __ARM_2D_SCALE_MASK_RGBVEC -#undef __ARM_2D_SCALE_MASK_RGBVEC_ACC - -#undef __API_MTWM_COPY_LIKE_OP_NAME -#undef __API_MTWM_OP_NAME -#undef __API_MTWM_PIXEL_BLENDING -#undef ____MTWM_FUNC -#undef ___MTWM_FUNC -#undef __MTWM_FUNC -#undef __API_MTWM_COLOUR -#undef __API_MTWM_COLOUR_NAME -#undef __API_MTWM_INT_TYPE -#undef __API_MTWM_INT_TYPE_BIT_NUM -#undef ____MTWM_TYPE -#undef ___MTWM_TYPE -#undef __MTWM_TYPE -#undef __API_MTWM_CFG_SUPPORT_SRC_MSK_WRAPING -#undef __API_MTWM_CFG_1_HORIZONTAL_LINE -#undef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT -#undef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE -#undef __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_TARGET_SIDE -#undef __API_MTWM_CFG_SUPPORT_SOURCE_MASK -#undef __API_MTWM_CFG_SUPPORT_TARGET_MASK -#undef __API_MTWM_CFG_SUPPORT_OPACITY diff --git a/package/Arm2D/Library/Source/__arm_2d_tile.c b/package/Arm2D/Library/Source/__arm_2d_tile.c deleted file mode 100644 index b1852cf79..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_tile.c +++ /dev/null @@ -1,2899 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_tile.c - * Description: Basic Tile operations - * - * $Date: 11. Aug 2022 - * $Revision: V.1.2.1 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wempty-translation-unit" -#endif - - -#ifdef __ARM_2D_COMPILATION_UNIT -#undef __ARM_2D_COMPILATION_UNIT - -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" -#include "__arm_2d_paving.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wmissing-variable-declarations" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 174,177,188,68,513,144 -#elif defined(__IS_COMPILER_GCC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" -#endif - -/*----------------------------------------------------------------------------* - * Code Template * - *----------------------------------------------------------------------------*/ - -#define __API_COLOUR c8bit -#define __API_INT_TYPE uint8_t -#define __API_INT_TYPE_BIT_NUM 8 - -#include "__arm_2d_copy.inc" - - -#define __API_COLOUR rgb16 -#define __API_INT_TYPE uint16_t -#define __API_INT_TYPE_BIT_NUM 16 - -#include "__arm_2d_copy.inc" - - -#define __API_COLOUR rgb32 -#define __API_INT_TYPE uint32_t -#define __API_INT_TYPE_BIT_NUM 32 - -#include "__arm_2d_copy.inc" - -/*----------------------------------------------------------------------------* - * Tile Operations * - *----------------------------------------------------------------------------*/ - -/* - HOW IT WORKS: - - Input Region 0 - +------------------------------------------------------+ - | | - | | - | | - | +------------------------------+---------+ - | | |/////////| - | | Output Region |/////////| - | | |/////////| - +-----------------------+------------------------------+/////////| - |////////////////////////////////////////| - |////////////////////////////////////////| - +----------------------------------------+ - Input Region 1 - */ -ARM_NONNULL(1,2) -bool arm_2d_region_intersect( const arm_2d_region_t *ptRegionIn0, - const arm_2d_region_t *ptRegionIn1, - arm_2d_region_t *ptRegionOut) -{ - assert(ptRegionIn0 != NULL); - assert(ptRegionIn1 != NULL); - - do { - arm_2d_location_t tLocationIn0End = { - .iX = ptRegionIn0->tLocation.iX - + ptRegionIn0->tSize.iWidth - - 1, - .iY = ptRegionIn0->tLocation.iY - + ptRegionIn0->tSize.iHeight - - 1, - }; - - arm_2d_location_t tLocationIn1End = { - .iX = ptRegionIn1->tLocation.iX - + ptRegionIn1->tSize.iWidth - - 1, - .iY = ptRegionIn1->tLocation.iY - + ptRegionIn1->tSize.iHeight - - 1, - }; - - arm_2d_location_t tLocationOutStart = { - .iX = MAX( ptRegionIn0->tLocation.iX, - ptRegionIn1->tLocation.iX), - - .iY = MAX( ptRegionIn0->tLocation.iY, - ptRegionIn1->tLocation.iY), - }; - - arm_2d_location_t tLocationOutEnd = { - .iX = MIN( tLocationIn0End.iX, - tLocationIn1End.iX), - .iY = MIN( tLocationIn0End.iY, - tLocationIn1End.iY), - }; - - if ( (tLocationOutStart.iX > tLocationOutEnd.iX) - || (tLocationOutStart.iY > tLocationOutEnd.iY)) { - return false; - } - - if (NULL != ptRegionOut) { - ptRegionOut->tLocation = tLocationOutStart; - ptRegionOut->tSize.iWidth = tLocationOutEnd.iX - - tLocationOutStart.iX - + 1; - - ptRegionOut->tSize.iHeight = tLocationOutEnd.iY - - tLocationOutStart.iY - + 1; - } - } while(0); - - return true; -} - -ARM_NONNULL(1,2) -bool arm_2d_is_point_inside_region( const arm_2d_region_t *ptRegion, - const arm_2d_location_t *ptPoint) -{ - assert(ptRegion != NULL); - assert(ptPoint != NULL); - - do { - if (ptPoint->iX < ptRegion->tLocation.iX) { - break; - } else if (ptPoint->iY < ptRegion->tLocation.iY) { - break; - } else if (ptPoint->iX >= ptRegion->tLocation.iX + ptRegion->tSize.iWidth) { - break; - } else if (ptPoint->iY >= ptRegion->tLocation.iY + ptRegion->tSize.iHeight) { - break; - } - - return true; - } while(0); - - return false; -} - -ARM_NONNULL(1,2) -const arm_2d_tile_t *__arm_2d_tile_get_root(const arm_2d_tile_t *ptTile, - arm_2d_region_t *ptValidRegion, - arm_2d_location_t *ptOffset, - arm_2d_tile_t **ppFirstDerivedChild) -{ - assert(NULL != ptTile); - assert(NULL != ptValidRegion); - - *ptValidRegion = ptTile->tRegion; - - if (NULL != ppFirstDerivedChild) { - *ppFirstDerivedChild = NULL; /* initialise */ - } - - if (NULL != ptOffset) { - ptOffset->iX = 0; - ptOffset->iY = 0; - } - - if (arm_2d_is_root_tile(ptTile)) { - return ptTile; - } - - do { - if (ptTile->tInfo.bDerivedResource) { - if (NULL != ppFirstDerivedChild) { - if (NULL == *ppFirstDerivedChild) { - *ppFirstDerivedChild = ptTile; - } - } - } - - //! get parent - ptTile = (const arm_2d_tile_t *)ptTile->ptParent; - if (NULL == ptTile) { - break; - } - - - - /*! \note Calculate the relative position between valid region and - *! the tile's original region. Usually, the tile's region - *! is inside the parent tile, but when the tile's location is - *! out of the parent's region with one or more negative axies, - *! the offset will be non-zero. - *! The offset is used to indicate the tile's view, and the - *! valid region is seen as inside the tile's region. - *! - *! Figure: What's the meaning of offset location - *! - *! The special case, where the child tile has a negative coordinates, - *! hence, the offset is (a,b) **as if** the valid region is inside - *! the child tile. - *! - *! (-a,-b) Child Tile - *! +------------------------------------+ - *! |///(0,0) Parent Tile ///////////////| - *! |/////+------------------------------+---------+ - *! |/////| | | - *! |/////| Valid Region | | - *! |/////| | | - *! +-----+------------------------------+ | - *! | | - *! | | - *! +----------------------------------------+ - *! - */ - if (NULL != ptOffset) { - arm_2d_location_t tOffset = ptValidRegion->tLocation; - tOffset.iX = MAX(0, -tOffset.iX); - tOffset.iY = MAX(0, -tOffset.iY); - - ptOffset->iX += tOffset.iX; - ptOffset->iY += tOffset.iY; - } - - /*! calculate the valid range in parent tile - *! - *! \note the location of the parent tile is used to indicate its - *! relative location between the it and its parent. - *! when calculate the valid range in parent, we have to assume - *! that the location is always (0,0) - *! - */ - arm_2d_region_t tParentRegion = { - .tSize = ptTile->tRegion.tSize, - }; - - if (arm_2d_is_root_tile(ptTile)) { - /* root tile can has offset */ - tParentRegion.tLocation = ptTile->tRegion.tLocation; - } - - /*! make sure the output region is valid */ - if (!arm_2d_region_intersect( &tParentRegion, - ptValidRegion, - ptValidRegion)) { - /* out of range */ - return NULL; - } - - if (arm_2d_is_root_tile(ptTile)) { - break; - } - - ptValidRegion->tLocation.iX += ptTile->tRegion.tLocation.iX; - ptValidRegion->tLocation.iY += ptTile->tRegion.tLocation.iY; - - } while(true); - - return ptTile; -} - -/* - HOW IT WORKS: - - Root Tile (Output Tile) - +------------------------------------------------------------------------+ - | ... ... | - | | - | Parent Tile | - | +------------------------------------+ | - | | Child Tile | | - | | +------------------------------+---------+ | - | | | |/////////| | - | | | Valid Region |/////////| | - | | | |/////////| | - | +-----+------------------------------+/////////| | - | |////////////////////////////////////////| | - | |////////////////////////////////////////| | - | +----------------------------------------+ | - | | - +------------------------------------------------------------------------+ - */ -ARM_NONNULL(1,2) -const arm_2d_tile_t *arm_2d_tile_get_root( const arm_2d_tile_t *ptTile, - arm_2d_region_t *ptValidRegion, - arm_2d_location_t *ptOffset) -{ - return __arm_2d_tile_get_root(ptTile, ptValidRegion, ptOffset, NULL); -} - -ARM_NONNULL(1,2) -arm_2d_cmp_t arm_2d_tile_width_compare( const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference) -{ - assert(ptTarget != NULL); - assert(ptReference != NULL); - arm_2d_region_t tTargetRegion; - arm_2d_region_t tReferenceRegion; - - ptTarget = arm_2d_tile_get_root(ptTarget, &tTargetRegion, NULL); - ptReference = arm_2d_tile_get_root(ptReference, &tReferenceRegion, NULL); - - if (NULL == ptTarget) { - if (NULL != ptReference) { - return ARM_2D_CMP_SMALLER; - } - return ARM_2D_CMP_EQUALS; - } else if (NULL == ptReference) { - return ARM_2D_CMP_LARGER; - } - - if (tTargetRegion.tSize.iWidth > tReferenceRegion.tSize.iWidth) { - return ARM_2D_CMP_LARGER; - } else if (tTargetRegion.tSize.iWidth < tReferenceRegion.tSize.iWidth) { - return ARM_2D_CMP_SMALLER; - } - - return ARM_2D_CMP_EQUALS; -} - - -ARM_NONNULL(1,2) -arm_2d_cmp_t arm_2d_tile_height_compare(const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference) -{ - assert(ptTarget != NULL); - assert(ptReference != NULL); - arm_2d_region_t tTargetRegion; - arm_2d_region_t tReferenceRegion; - - ptTarget = arm_2d_tile_get_root(ptTarget, &tTargetRegion, NULL); - ptReference = arm_2d_tile_get_root(ptReference, &tReferenceRegion, NULL); - - if (NULL == ptTarget) { - if (NULL != ptReference) { - return ARM_2D_CMP_SMALLER; - } - return ARM_2D_CMP_EQUALS; - } else if (NULL == ptReference) { - return ARM_2D_CMP_LARGER; - } - - if (tTargetRegion.tSize.iHeight > tReferenceRegion.tSize.iHeight) { - return ARM_2D_CMP_LARGER; - } else if (tTargetRegion.tSize.iHeight < tReferenceRegion.tSize.iHeight) { - return ARM_2D_CMP_SMALLER; - } - - return ARM_2D_CMP_EQUALS; -} - -ARM_NONNULL(1,2) -arm_2d_cmp_t arm_2d_tile_shape_compare( const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference) -{ - assert(ptTarget != NULL); - assert(ptReference != NULL); - arm_2d_region_t tTargetRegion; - arm_2d_region_t tReferenceRegion; - - ptTarget = arm_2d_tile_get_root(ptTarget, &tTargetRegion, NULL); - ptReference = arm_2d_tile_get_root(ptReference, &tReferenceRegion, NULL); - - if (NULL == ptTarget) { - if (NULL != ptReference) { - return ARM_2D_CMP_SMALLER; - } - return ARM_2D_CMP_EQUALS; - } else if (NULL == ptReference) { - return ARM_2D_CMP_LARGER; - } - - if (tTargetRegion.tSize.iWidth < tReferenceRegion.tSize.iWidth) { - return ARM_2D_CMP_SMALLER; - } - - if (tTargetRegion.tSize.iHeight < tReferenceRegion.tSize.iHeight) { - return ARM_2D_CMP_SMALLER; - } - - if ( (tTargetRegion.tSize.iWidth == tReferenceRegion.tSize.iWidth) - && (tTargetRegion.tSize.iHeight == tReferenceRegion.tSize.iHeight)) { - return ARM_2D_CMP_EQUALS; - } - - return ARM_2D_CMP_LARGER; -} - - -ARM_NONNULL(1,2) -const arm_2d_tile_t * arm_2d_get_absolute_location( - const arm_2d_tile_t *ptTile, - arm_2d_location_t *ptLocation) -{ - - assert(NULL != ptTile); - assert(NULL != ptLocation); - - ptLocation->iX = 0; - ptLocation->iY = 0; - - while( !ptTile->tInfo.bIsRoot ) { - ptLocation->iX += ptTile->tRegion.tLocation.iX; - ptLocation->iY += ptTile->tRegion.tLocation.iY; - - ptTile = ptTile->ptParent; - } - - return ptTile; -} - -ARM_NONNULL(1,2,3) -arm_2d_region_t *arm_2d_tile_region_diff( const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptReference, - arm_2d_region_t *ptBuffer) -{ - assert(NULL != ptTarget); - assert(NULL != ptReference); - assert(NULL != ptBuffer); - - //! get the absolute location - arm_2d_location_t tTargetAbsoluteLocaton, tReferenceAbsoluteLocation; - - ptBuffer->tSize.iWidth = ptTarget->tRegion.tSize.iWidth - - ptReference->tRegion.tSize.iWidth; - ptBuffer->tSize.iHeight = ptTarget->tRegion.tSize.iHeight - - ptReference->tRegion.tSize.iHeight; - - ptTarget = arm_2d_get_absolute_location(ptTarget, &tTargetAbsoluteLocaton); - ptReference = arm_2d_get_absolute_location(ptReference, &tReferenceAbsoluteLocation); - - if (ptTarget != ptReference) { - //! they don't have the same root - return NULL; - } - - ptBuffer->tLocation.iX = tTargetAbsoluteLocaton.iX - - tReferenceAbsoluteLocation.iX; - ptBuffer->tLocation.iY = tTargetAbsoluteLocaton.iY - - tReferenceAbsoluteLocation.iY; - - return ptBuffer; -} - -/* - HOW IT WORKS: - - Parent Tile (Are NOT necessarily a ROOT tile ) - +------------------------------------------------------+ - | | - | | - | Target Region | - | +------------------------------+---------+ - | | |/////////| - | | New Child Tile (Output) |/////////| - | | |/////////| - +-----------------------+------------------------------+/////////| - |////////////////////////////////////////| - |////////////////////////////////////////| - +----------------------------------------+ - */ -ARM_NONNULL(1,2,3) -arm_2d_tile_t *arm_2d_tile_generate_child( - const arm_2d_tile_t *ptParentTile, - const arm_2d_region_t *ptRegion, - arm_2d_tile_t *ptOutput, - bool bClipRegion) -{ - assert(NULL != ptParentTile); - assert(NULL != ptRegion); - assert(NULL != ptOutput); - - memset(ptOutput, 0, sizeof(arm_2d_tile_t)); - ptOutput->tRegion = *ptRegion; - - arm_2d_region_t tParentRegion = { - .tSize = ptParentTile->tRegion.tSize, - }; - - if (bClipRegion) { - if (!arm_2d_region_intersect( &tParentRegion, - &(ptOutput->tRegion), - &(ptOutput->tRegion) - )) { - /* out of range */ - return NULL; - } - } else { - /*! \note since you are allowed to generate a child tile whose region is - *! bigger than its parent, so we don't have to clip it, see **note** - *! below. - */ - if (!arm_2d_region_intersect( &tParentRegion, - &(ptOutput->tRegion), - NULL //&(ptOutput->tRegion) //!< **note** - )) { - /* out of range */ - return NULL; - } - } - - ptOutput->tInfo = ptParentTile->tInfo; - ptOutput->tInfo.bIsRoot = false; - - /* user has to manually set this flag to true to indicate a derived resource */ - ptOutput->tInfo.bDerivedResource = false; - - ptOutput->ptParent = (arm_2d_tile_t *)ptParentTile; - - return ptOutput; -} - - -/*----------------------------------------------------------------------------* - * Copy/Fill tile to destination with Mirroring * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy(arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy(arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy(arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - __arm_2d_impl_c8bit_copy_mirror(ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __arm_2d_impl_c8bit_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - __arm_2d_impl_rgb16_copy_mirror(ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __arm_2d_impl_rgb16_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - __arm_2d_impl_rgb32_copy_mirror(ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode); - } else { - __arm_2d_impl_rgb32_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __arm_2d_impl_c8bit_fill_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - wMode); - - - } else { - __arm_2d_impl_c8bit_fill( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __arm_2d_impl_rgb16_fill_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - wMode); - - - } else { - __arm_2d_impl_rgb16_fill( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - } - - return arm_fsm_rt_cpl; -} - - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __arm_2d_impl_rgb32_fill_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - wMode); - - } else { - __arm_2d_impl_rgb32_fill( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - } - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Copy Only * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_ONLY_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_ONLY_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_ONLY_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_only( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_only( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_only( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Copy with X mirroring * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_X_MIRROR_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_X_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_X_MIRROR_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_X_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_X_MIRROR_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_X_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_x_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_copy_x_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_x_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_copy_x_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_x_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_copy_x_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Copy with Y mirroring * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_Y_MIRROR_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_Y_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_Y_MIRROR_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_Y_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_Y_MIRROR_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_Y_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_y_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_copy_y_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_y_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_copy_y_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_y_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_copy_y_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Copy with XY mirroring * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_XY_MIRROR_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_XY_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_XY_MIRROR_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_XY_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_XY_MIRROR_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_XY_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_xy_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_copy_xy_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_xy_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_copy_xy_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_xy_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_copy_xy_mirror( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - - return arm_fsm_rt_cpl; -} - - -/*----------------------------------------------------------------------------* - * Fill Only * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_ONLY_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_ONLY_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_only( arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_ONLY_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_only( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_fill( ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_only( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_fill( ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_only( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_fill( ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Fill with X mirroring * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_X_MIRROR_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_X_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_X_MIRROR_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_X_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_with_x_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_X_MIRROR_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_X_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_x_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_fill_x_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_x_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_fill_x_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_x_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_fill_x_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Fill with Y mirroring * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_Y_MIRROR_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_Y_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_Y_MIRROR_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_Y_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_with_y_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_Y_MIRROR_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_Y_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_y_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_fill_y_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_y_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_fill_y_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_y_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_fill_y_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Fill with XY mirroring * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_fill_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_XY_MIRROR_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_XY_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_fill_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_XY_MIRROR_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_XY_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_fill_with_xy_mirror( - arm_2d_op_cp_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion) -{ - - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_FILL_XY_MIRROR_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = ARM_2D_CP_MODE_FILL | ARM_2D_CP_MODE_XY_MIRROR; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_xy_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_fill_xy_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_xy_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_fill_xy_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_xy_mirror( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_fill_xy_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize); - - return arm_fsm_rt_cpl; -} - - - -/*----------------------------------------------------------------------------* - * Copy/Fill with colour-keying and Mirroring * - *----------------------------------------------------------------------------*/ - -/*! \brief copy source tile to destination tile and use destination tile as - *! background. When encountering specified mask colour, the background - *! pixel should be used, otherwise the foreground pixel from source tile - *! is used. - *! - *! \note All color formats which using 8bits per pixel are treated equally. - *! - */ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_tile_copy_with_colour_keying( - arm_2d_op_cp_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint8_t chMaskColour, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - OP_CORE.ptOp = - &ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.chColour = chMaskColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! \brief copy source tile to destination tile and use destination tile as - *! background. When encountering specified mask colour, the background - *! pixel should be used, otherwise the foreground pixel from source tile - *! is used. - *! - *! \note All color formats which using 16bits per pixel are treated equally. - *! - *! \note alpha channel is not handled, i.e. rgba5551 - */ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_tile_copy_with_colour_keying( - arm_2d_op_cp_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint16_t hwMaskColour, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - OP_CORE.ptOp = - &ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.hwColour = hwMaskColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! \brief copy source tile to destination tile and use destination tile as - *! background. When encountering specified mask colour, the background - *! pixel should be used, otherwise the foreground pixel from source tile - *! is used. - *! - *! \note All color formats which using 32bits per pixel are treated equally. - *! - *! \note alpha channel is not handled. - */ -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_tile_copy_with_colour_keying( - arm_2d_op_cp_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMaskColour, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - OP_CORE.ptOp = - &ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.wColour = wMaskColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_copy_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptTask->ptOP) - - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __arm_2d_impl_c8bit_cl_key_copy_mirror( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode, - this.hwColour); - - } else { - __arm_2d_impl_c8bit_cl_key_copy( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.hwColour); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_copy_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptTask->ptOP) - - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __arm_2d_impl_rgb16_cl_key_copy_mirror( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode, - this.hwColour); - - } else { - __arm_2d_impl_rgb16_cl_key_copy( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.hwColour); - } - - return arm_fsm_rt_cpl; -} - - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_copy_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptTask->ptOP) - - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __arm_2d_impl_rgb32_cl_key_copy_mirror( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode, - this.wColour); - } else { - __arm_2d_impl_rgb32_cl_key_copy( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.wColour); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_tile_fill_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - __arm_2d_impl_c8bit_cl_key_fill_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - wMode, - this.hwColour); - } else { - __arm_2d_impl_c8bit_cl_key_fill( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - this.hwColour); - } - - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_tile_fill_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - __arm_2d_impl_rgb16_cl_key_fill_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - wMode, - this.hwColour); - } else { - __arm_2d_impl_rgb16_cl_key_fill( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - this.hwColour); - } - - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_tile_fill_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cp_cl_key_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - uint32_t wMode = this.wMode; - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - - __arm_2d_impl_rgb32_cl_key_fill_mirror( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - wMode, - this.wColour); - - } else { - - __arm_2d_impl_rgb32_cl_key_fill( - ptTask->Param.tFill.tSource.pBuffer, - ptTask->Param.tFill.tSource.iStride, - &ptTask->Param.tFill.tSource.tValidRegion.tSize, - ptTask->Param.tFill.tTarget.pBuffer, - ptTask->Param.tFill.tTarget.iStride, - &ptTask->Param.tFill.tTarget.tValidRegion.tSize, - this.wColour); - - } - - - return arm_fsm_rt_cpl; -} - - -/*----------------------------------------------------------------------------* - * Low Level IO Interfaces * - *----------------------------------------------------------------------------*/ -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_C8BIT, __arm_2d_c8bit_sw_tile_copy); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_RGB16, __arm_2d_rgb16_sw_tile_copy); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_RGB32, __arm_2d_rgb32_sw_tile_copy); - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_ONLY_C8BIT, __arm_2d_c8bit_sw_tile_copy_only); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_ONLY_RGB16, __arm_2d_rgb16_sw_tile_copy_only); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_ONLY_RGB32, __arm_2d_rgb32_sw_tile_copy_only); - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_C8BIT, __arm_2d_c8bit_sw_tile_copy_x_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_RGB16, __arm_2d_rgb16_sw_tile_copy_x_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_RGB32, __arm_2d_rgb32_sw_tile_copy_x_mirror); - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_C8BIT, __arm_2d_c8bit_sw_tile_copy_y_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_RGB16, __arm_2d_rgb16_sw_tile_copy_y_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_RGB32, __arm_2d_rgb32_sw_tile_copy_y_mirror); - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_C8BIT, __arm_2d_c8bit_sw_tile_copy_xy_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_RGB16, __arm_2d_rgb16_sw_tile_copy_xy_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_RGB32, __arm_2d_rgb32_sw_tile_copy_xy_mirror); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_ONLY_C8BIT, __arm_2d_c8bit_sw_tile_fill_only); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_ONLY_RGB16, __arm_2d_rgb16_sw_tile_fill_only); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_ONLY_RGB32, __arm_2d_rgb32_sw_tile_fill_only); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_X_MIRROR_C8BIT, __arm_2d_c8bit_sw_tile_fill_x_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_X_MIRROR_RGB16, __arm_2d_rgb16_sw_tile_fill_x_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_X_MIRROR_RGB32, __arm_2d_rgb32_sw_tile_fill_x_mirror); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_Y_MIRROR_C8BIT, __arm_2d_c8bit_sw_tile_fill_y_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_Y_MIRROR_RGB16, __arm_2d_rgb16_sw_tile_fill_y_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_Y_MIRROR_RGB32, __arm_2d_rgb32_sw_tile_fill_y_mirror); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_XY_MIRROR_C8BIT, __arm_2d_c8bit_sw_tile_fill_xy_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_XY_MIRROR_RGB16, __arm_2d_rgb16_sw_tile_fill_xy_mirror); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_XY_MIRROR_RGB32, __arm_2d_rgb32_sw_tile_fill_xy_mirror); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_C8BIT, __arm_2d_c8bit_sw_tile_fill); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_RGB16, __arm_2d_rgb16_sw_tile_fill); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_RGB32, __arm_2d_rgb32_sw_tile_fill); - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_COLOUR_MASKING_C8BIT, - __arm_2d_c8bit_sw_tile_copy_with_colour_keying); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_COLOUR_MASKING_RGB16, - __arm_2d_rgb16_sw_tile_copy_with_colour_keying); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_COLOUR_MASKING_RGB32, - __arm_2d_rgb32_sw_tile_copy_with_colour_keying); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_COLOUR_MASKING_C8BIT, - __arm_2d_c8bit_sw_tile_fill_with_colour_keying); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_COLOUR_MASKING_RGB16, - __arm_2d_rgb16_sw_tile_fill_with_colour_keying); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_COLOUR_MASKING_RGB32, - __arm_2d_rgb32_sw_tile_fill_with_colour_keying); - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_C8BIT), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_C8BIT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_RGB16), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_RGB16), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_RGB32), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_RGB32), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_ONLY_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_ONLY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_ONLY_C8BIT), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_ONLY_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_ONLY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_ONLY_RGB16), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_ONLY_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_ONLY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_ONLY_RGB32), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_X_MIRROR_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_X_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_C8BIT), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_X_MIRROR_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_X_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_RGB16), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_X_MIRROR_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_X_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_RGB32), - .ptFillLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_Y_MIRROR_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_Y_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_C8BIT), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_Y_MIRROR_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_Y_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_RGB16), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_Y_MIRROR_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_Y_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_RGB32), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_XY_MIRROR_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_XY_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_C8BIT), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_XY_MIRROR_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_XY_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_RGB16), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_XY_MIRROR_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_XY_MIRROR, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_RGB32), - .ptFillLike = NULL, - }, - }, -}; - - - - - - - - - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_ONLY_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_ONLY, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_ONLY_C8BIT), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_ONLY_C8BIT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_ONLY_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_ONLY, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_ONLY_RGB16), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_ONLY_RGB16), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_ONLY_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_ONLY, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_ONLY_RGB32), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_ONLY_RGB32), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_X_MIRROR_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_X_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_X_MIRROR_C8BIT), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_C8BIT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_X_MIRROR_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_X_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_X_MIRROR_RGB16), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_RGB16), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_X_MIRROR_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_X_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_X_MIRROR_RGB32), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_X_MIRROR_RGB32), - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_Y_MIRROR_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_Y_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_Y_MIRROR_C8BIT), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_C8BIT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_Y_MIRROR_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_Y_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_Y_MIRROR_RGB16), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_RGB16), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_Y_MIRROR_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_Y_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_Y_MIRROR_RGB32), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_Y_MIRROR_RGB32), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_XY_MIRROR_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_XY_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_XY_MIRROR_C8BIT), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_C8BIT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_XY_MIRROR_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_XY_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_XY_MIRROR_RGB16), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_RGB16), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_FILL_XY_MIRROR_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_WITH_XY_MIRROR, - - .LowLevelIO = { - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_XY_MIRROR_RGB32), - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_XY_MIRROR_RGB32), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_COLOUR_KEYING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_COLOUR_MASKING_C8BIT), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_COLOUR_MASKING_C8BIT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB16, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_COLOUR_KEYING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_COLOUR_MASKING_RGB16), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_COLOUR_MASKING_RGB16), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_COLOUR_KEYING_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB32, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_COLOUR_KEYING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_COLOUR_MASKING_RGB32), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_COLOUR_MASKING_RGB32), - }, - }, -}; - - - -#if defined(__clang__) -# pragma clang diagnostic pop -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_warning 174,177,188,68,513,144 -#elif defined(__IS_COMPILER_GCC__) -# pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/package/Arm2D/Library/Source/__arm_2d_transform.inc b/package/Arm2D/Library/Source/__arm_2d_transform.inc deleted file mode 100644 index 6a2878c28..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_transform.inc +++ /dev/null @@ -1,820 +0,0 @@ - -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_fill_colour.inc - * Description: c code template for drawing pattern - * - * $Date: 20. May 2022 - * $Revision: V.1.1.1 - * - * -------------------------------------------------------------------- */ - - -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_INT_TYPE -# error You have to define the __API_INT_TYPE before using this c template -#endif -#ifndef __API_INT_TYPE_BIT_NUM -# error You have to define the __API_INT_TYPE_BIT_NUM before using this c template -#endif -#ifndef __API_PIXEL_BLENDING -# error You have to define __API_PIXEL_BLENDING before using this c template -#endif -#ifndef __API_PIXEL_AVERAGE -# error You have to define __API_PIXEL_AVERAGE before using this c template -#endif -#ifndef __API_PIXEL_AVERAGE_RESULT -# error You have to define __API_PIXEL_AVERAGE_RESULT before using this c template -#endif -#ifndef __API_PIXEL_AVERAGE_INIT -# define __API_PIXEL_AVERAGE_INIT() __arm_2d_color_fast_rgb_t tPixel = {0}; -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __arm_2d_impl_##__COLOUR##_##__NAME -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR) - -#define MASK_COLOR(sz) (sz == 8) ? ptInfo->Mask.chColour : ((sz == 16) ? ptInfo->Mask.hwColour : ptInfo->Mask.wColour) - -static -arm_2d_point_float_t *__arm_2d_transform_point( - const arm_2d_location_t *ptLocation, - const arm_2d_location_t *ptCenter, - float fAngle, - float fScale, - arm_2d_point_float_t *ptOutBuffer); - -static -void __arm_2d_transform_regression( arm_2d_size_t * __RESTRICT ptCopySize, - arm_2d_location_t * pSrcPoint, - float fAngle, - float fScale, - arm_2d_location_t * tOffset, - arm_2d_location_t * ptCenter, - arm_2d_rot_linear_regr_t regrCoefs[]); - - -/*! \note Please only set this to zero for function correctness verification of - *! __arm_2d_meta_trans_with_masks.inc - */ -#if 1 - -extern -void __ARM_2D_FUNC(transform)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo); - -extern -void __ARM_2D_FUNC(transform_with_opacity)(__arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio); - -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - -static -void __ARM_2D_FUNC(get_pixel_colour)( arm_2d_point_float_t *ptPoint, - arm_2d_region_t *ptOrigValidRegion, - __API_INT_TYPE *pOrigin, - int16_t iOrigStride, - //arm_2d_location_t *ptTargetPoint, - //arm_2d_region_t *ptTargetValidRegion, - __API_INT_TYPE *pTarget, - //int16_t iTargetSride, - __API_INT_TYPE MaskColour) -{ -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) \ - && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - - arm_2d_location_t tOriginLocation; - - tOriginLocation.iX = ptPoint->fX; - tOriginLocation.iY = ptPoint->fY; - - __arm_2d_point_adj_alpha_t tAdjacentArray - = __arm_2d_point_get_adjacent_alpha_fp(ptPoint); - - __API_PIXEL_AVERAGE_INIT(); - - __API_INT_TYPE TempPixel; - bool bIsInside = false; - - for (int_fast8_t n = 0; n < 4; n++) { - uint16_t hwAlpha = tAdjacentArray.tMatrix[n].chAlpha; - - arm_2d_location_t tTemp = { - .iX = tOriginLocation.iX + tAdjacentArray.tMatrix[n].tOffset.iX, - .iY = tOriginLocation.iY + tAdjacentArray.tMatrix[n].tOffset.iY, - }; - TempPixel = (*pTarget); - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - - __API_INT_TYPE OriginPixel = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - if (OriginPixel != MaskColour) { - bIsInside = true; - TempPixel = OriginPixel; - } - } - - __API_PIXEL_AVERAGE(TempPixel, hwAlpha); - } - - if (bIsInside) { - (*pTarget) = __API_PIXEL_AVERAGE_RESULT(); - } - -#else - arm_2d_location_t tOriginLocation; - - tOriginLocation.iX = ptPoint->fX; - tOriginLocation.iY = ptPoint->fY; - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tOriginLocation)) { - __API_INT_TYPE Temp = pOrigin[ tOriginLocation.iY * iOrigStride - + tOriginLocation.iX]; - if (Temp != MaskColour) { - *pTarget = Temp; - } - } -#endif -} - -__WEAK -void __ARM_2D_FUNC(transform)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo) -{ - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - float invIWidth = iWidth > 1 ? 1.0f / (float) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - regrCoefs); - - /* slopes between 1st and last cols */ - float slopeY, slopeX; - - slopeY = (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - - for (int_fast16_t x = 0; x < iWidth; x++) { - arm_2d_point_float_t tPoint; - - /* linear interpolation thru first & last cols */ - tPoint.fX = colFirstX + slopeX * x; - tPoint.fY = colFirstY + slopeY * x; - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__) - if (tPoint.fX > 0) { - tPoint.fX += __CALIB; - } else { - tPoint.fX -= __CALIB; - } - if (tPoint.fY > 0) { - tPoint.fY += __CALIB; - } else { - tPoint.fY -= __CALIB; - } - #endif - - __ARM_2D_FUNC(get_pixel_colour)( - &tPoint, - &ptParam->tOrigin.tValidRegion, - ptParam->tOrigin.pBuffer, - iOrigStride, - - pTargetBase, - //iTargetStride, - MaskColour - ); - pTargetBase++; - } - //phwSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - } -} - -#else /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - -static -void __ARM_2D_FUNC(get_pixel_colour)( arm_2d_point_fx_t *ptFxPoint, - arm_2d_region_t *ptOrigValidRegion, - __API_INT_TYPE *pOrigin, - int16_t iOrigStride, - __API_INT_TYPE *pTarget, - //int16_t iTargetSride, - __API_INT_TYPE MaskColour) -{ -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) \ - && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - - arm_2d_location_t tOriginLocation = { - .iX = ptFxPoint->X >> 16, - .iY = ptFxPoint->Y >> 16, - }; - - __arm_2d_point_adj_alpha_t tAdjacentArray - = __arm_2d_point_get_adjacent_alpha_q16(ptFxPoint); - - __API_PIXEL_AVERAGE_INIT(); - - __API_INT_TYPE TempPixel; - bool bIsInside = false; - - for (int_fast8_t n = 0; n < 4; n++) { - uint16_t hwAlpha = tAdjacentArray.tMatrix[n].chAlpha; - - arm_2d_location_t tTemp = { - .iX = tOriginLocation.iX + tAdjacentArray.tMatrix[n].tOffset.iX, - .iY = tOriginLocation.iY + tAdjacentArray.tMatrix[n].tOffset.iY, - }; - TempPixel = (*pTarget); - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - - __API_INT_TYPE Temp = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - if (Temp != MaskColour) { - bIsInside = true; - TempPixel = Temp; - } - } - - __API_PIXEL_AVERAGE(TempPixel, hwAlpha); - } - - if (bIsInside) { - *pTarget = __API_PIXEL_AVERAGE_RESULT(); - } -#else - arm_2d_location_t tPoint = { - .iX = ptFxPoint->X >> 16, - .iY = ptFxPoint->Y >> 16, - }; - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tPoint)) { - __API_INT_TYPE Temp = pOrigin[ tPoint.iY * iOrigStride - + tPoint.iX]; - if (Temp != MaskColour) { - *pTarget = Temp; - } - } -#endif -} - -__WEAK -void __ARM_2D_FUNC(transform)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo) -{ - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - q31_t invIWidth = iWidth > 1 ? 0x7fffffff / (iWidth - 1) : 0x7fffffff; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - regrCoefs); - - /* slopes between 1st and last cols */ - int32_t slopeY, slopeX; - - slopeY = - MULTFX((regrCoefs[1].interceptY - regrCoefs[0].interceptY), invIWidth); - slopeX = - MULTFX((regrCoefs[1].interceptX - regrCoefs[0].interceptX), invIWidth); - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - - for (int_fast16_t x = 0; x < iWidth; x++) { - arm_2d_point_fx_t tPointFast; - - tPointFast.X = __QDADD(colFirstX, slopeX * x); - tPointFast.Y = __QDADD(colFirstY, slopeY * x); - -#define __CALIBFX 590 - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__) - if (tPointFast.X > 0) { - tPointFast.X += __CALIBFX; - } else { - tPointFast.X -= __CALIBFX; - } - if (tPointFast.Y > 0) { - tPointFast.Y += __CALIBFX; - } else { - tPointFast.Y -= __CALIBFX; - } - #endif - - __ARM_2D_FUNC(get_pixel_colour)( - &tPointFast, - &ptParam->tOrigin.tValidRegion, - pOrigin, - iOrigStride, - pTargetBase, - //iTargetStride, - MaskColour - ); - pTargetBase++; - } - //phwSourceBase += (iSourceStride - iWidth); - pTargetBase += (iTargetStride - iWidth); - } -} - -#endif - - - -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ -static -void __ARM_2D_FUNC(get_pixel_colour_with_alpha)( - arm_2d_point_float_t *ptPoint, - arm_2d_region_t *ptOrigValidRegion, - __API_INT_TYPE *pOrigin, - int16_t iOrigStride, - __API_INT_TYPE *pTarget, - //int16_t iTargetSride, - __API_INT_TYPE MaskColour, - uint_fast16_t hwOpacity) -{ -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) \ - && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - arm_2d_location_t tOriginLocation; - - tOriginLocation.iX = ptPoint->fX; - tOriginLocation.iY = ptPoint->fY; - - __arm_2d_point_adj_alpha_t tAdjacentArray - = __arm_2d_point_get_adjacent_alpha_fp(ptPoint); - - __API_PIXEL_AVERAGE_INIT(); - - __API_INT_TYPE TempPixel; - bool bIsInside = false; - - for (int_fast8_t n = 0; n < 4; n++) { - uint16_t hwAlpha = tAdjacentArray.tMatrix[n].chAlpha; - - arm_2d_location_t tTemp = { - .iX = tOriginLocation.iX + tAdjacentArray.tMatrix[n].tOffset.iX, - .iY = tOriginLocation.iY + tAdjacentArray.tMatrix[n].tOffset.iY, - }; - TempPixel = (*pTarget); - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - - __API_INT_TYPE OriginPixel = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - if (OriginPixel != MaskColour) { - bIsInside = true; - TempPixel = OriginPixel; - } - } - - __API_PIXEL_AVERAGE(TempPixel, hwAlpha); - } - - if (bIsInside) { - __API_INT_TYPE tSourcPixel = __API_PIXEL_AVERAGE_RESULT(); - - __API_PIXEL_BLENDING( &tSourcPixel, pTarget, hwOpacity); - } - -#else - arm_2d_location_t tOriginLocation; - - tOriginLocation.iX = ptPoint->fX; - tOriginLocation.iY = ptPoint->fY; - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tOriginLocation)) { - __API_INT_TYPE Temp = pOrigin[ tOriginLocation.iY * iOrigStride - + tOriginLocation.iX]; - if (Temp != MaskColour) { - //Pixel = Temp; - - __API_PIXEL_BLENDING( &Temp, pTarget, hwOpacity); - } - } -#endif -} -#else -__WEAK -void __ARM_2D_FUNC(get_pixel_colour_with_alpha)( - arm_2d_point_fx_t *ptFxPoint, - arm_2d_region_t *ptOrigValidRegion, - __API_INT_TYPE *pOrigin, - int16_t iOrigStride, - __API_INT_TYPE *pTarget, - //int16_t iTargetSride, - __API_INT_TYPE MaskColour, - uint_fast16_t hwOpacity) -{ -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) \ - && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - arm_2d_location_t tOriginLocation = { - .iX = ptFxPoint->X >> 16, - .iY = ptFxPoint->Y >> 16, - }; - - __arm_2d_point_adj_alpha_t tAdjacentArray - = __arm_2d_point_get_adjacent_alpha_q16(ptFxPoint); - - __API_PIXEL_AVERAGE_INIT(); - - __API_INT_TYPE TempPixel; - bool bIsInside = false; - - for (int_fast8_t n = 0; n < 4; n++) { - uint16_t hwAlpha = tAdjacentArray.tMatrix[n].chAlpha; - - arm_2d_location_t tTemp = { - .iX = tOriginLocation.iX + tAdjacentArray.tMatrix[n].tOffset.iX, - .iY = tOriginLocation.iY + tAdjacentArray.tMatrix[n].tOffset.iY, - }; - TempPixel = (*pTarget); - - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tTemp)) { - - __API_INT_TYPE Temp = pOrigin[ tTemp.iY * iOrigStride - + tTemp.iX]; - - if (Temp != MaskColour) { - bIsInside = true; - TempPixel = Temp; - } - } - - __API_PIXEL_AVERAGE(TempPixel, hwAlpha); - } - - if (bIsInside) { - __API_INT_TYPE tSourcPixel = __API_PIXEL_AVERAGE_RESULT(); - - __API_PIXEL_BLENDING( &tSourcPixel, pTarget, hwOpacity); - } - -#else - - arm_2d_location_t tPoint = { - .iX = ptFxPoint->X >> 16, - .iY = ptFxPoint->Y >> 16, - }; - if (arm_2d_is_point_inside_region(ptOrigValidRegion, &tPoint)) { - __API_INT_TYPE Temp = pOrigin[ tPoint.iY * iOrigStride - + tPoint.iX]; - if (Temp != MaskColour) { - __API_PIXEL_BLENDING( &Temp, pTarget, hwOpacity); - } - } - -#endif -} -#endif - - -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ -__WEAK -void __ARM_2D_FUNC(transform_with_opacity)(__arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio) -{ - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - float invIWidth = iWidth > 1 ? 1.0f / (float) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - regrCoefs); - - /* slopes between 1st and last cols */ - float slopeY, slopeX; - - slopeY = (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - - - for (int_fast16_t x = 0; x < iWidth; x++) { - arm_2d_point_float_t tPoint; - - /* linear interpolation thru first & last cols */ - tPoint.fX = colFirstX + slopeX * x; - tPoint.fY = colFirstY + slopeY * x; - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__) - if (tPoint.fX > 0) { - tPoint.fX += __CALIB; - } else { - tPoint.fX -= __CALIB; - } - if (tPoint.fY > 0) { - tPoint.fY += __CALIB; - } else { - tPoint.fY -= __CALIB; - } - #endif - - __ARM_2D_FUNC(get_pixel_colour_with_alpha) ( - &tPoint, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBase, - MaskColour, - hwRatio); - pTargetBase++; - } - pTargetBase += (iTargetStride - iWidth); - } -} - -#else /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - -__WEAK -void __ARM_2D_FUNC(transform_with_opacity)(__arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio) -{ - int_fast16_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int_fast16_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int_fast16_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int_fast16_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - q31_t invIWidth = iWidth > 1 ? 0x7fffffff / (iWidth - 1) : 0x7fffffff; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - &(ptInfo->tCenter), - regrCoefs); - - /* slopes between 1st and last cols */ - int32_t slopeY, slopeX; - - slopeY = - MULTFX((regrCoefs[1].interceptY - regrCoefs[0].interceptY), invIWidth); - slopeX = - MULTFX((regrCoefs[1].interceptX - regrCoefs[0].interceptX), invIWidth); - - for (int_fast16_t y = 0; y < iHeight; y++) { - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - - for (int_fast16_t x = 0; x < iWidth; x++) { - arm_2d_point_fx_t tPointFast; - - tPointFast.X = __QDADD(colFirstX, slopeX * x); - tPointFast.Y = __QDADD(colFirstY, slopeY * x); - -#define __CALIBFX 590 - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__) - if (tPointFast.X > 0) { - tPointFast.X += __CALIBFX; - } else { - tPointFast.X -= __CALIBFX; - } - if (tPointFast.Y > 0) { - tPointFast.Y += __CALIBFX; - } else { - tPointFast.Y -= __CALIBFX; - } - #endif - - __ARM_2D_FUNC(get_pixel_colour_with_alpha) ( - &tPointFast, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBase, - MaskColour, - hwRatio); - pTargetBase++; - } - pTargetBase += (iTargetStride - iWidth); - } -} - -#endif /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ -#else - - -# define __API_MTWM_COLOUR __API_COLOUR -# define __API_MTWM_INT_TYPE __API_INT_TYPE -# define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -# define __API_MTWM_PIXEL_BLENDING __API_PIXEL_BLENDING -# define __API_MTWM_PIXEL_AVERAGE __API_PIXEL_AVERAGE -# define __API_MTWM_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT -# define __API_MTWM_PIXEL_AVERAGE_INIT __API_PIXEL_AVERAGE_INIT - -# define get_pixel_colour_mask get_pixel_colour -# define transform_with_mask transform - -# include "__arm_2d_meta_trans_with_masks.inc" - -# define __API_MTWM_COLOUR __API_COLOUR -# define __API_MTWM_INT_TYPE __API_INT_TYPE -# define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -# define __API_MTWM_PIXEL_BLENDING __API_PIXEL_BLENDING -# define __API_MTWM_PIXEL_AVERAGE __API_PIXEL_AVERAGE -# define __API_MTWM_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT -# define __API_MTWM_PIXEL_AVERAGE_INIT __API_PIXEL_AVERAGE_INIT -# define __API_MTWM_CFG_SUPPORT_OPACITY 1 - -# define get_pixel_colour_mask get_pixel_colour_with_opacity -# define transform_with_mask transform_with_opacity - -# include "__arm_2d_meta_trans_with_masks.inc" -#endif - -#define __API_MTWM_COLOUR __API_COLOUR -#define __API_MTWM_INT_TYPE __API_INT_TYPE -#define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -#define __API_MTWM_PIXEL_BLENDING __API_PIXEL_BLENDING -#define __API_MTWM_PIXEL_AVERAGE __API_PIXEL_AVERAGE -#define __API_MTWM_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT -#define __API_MTWM_PIXEL_AVERAGE_INIT __API_PIXEL_AVERAGE_INIT -#define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 - -#define get_pixel_colour_mask get_pixel_colour_src_mask -#define transform_with_mask transform_with_src_mask - -#include "__arm_2d_meta_trans_with_masks.inc" - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ -# define __API_MTWM_COLOUR __API_COLOUR -# define __API_MTWM_INT_TYPE __API_INT_TYPE -# define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -# define __API_MTWM_PIXEL_BLENDING __API_PIXEL_BLENDING -# define __API_MTWM_PIXEL_AVERAGE __API_PIXEL_AVERAGE -# define __API_MTWM_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT -# define __API_MTWM_PIXEL_AVERAGE_INIT __API_PIXEL_AVERAGE_INIT -# define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 -# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define get_pixel_colour_mask get_pixel_colour_src_chn_mask -# define transform_with_mask transform_with_src_chn_mask - -# include "__arm_2d_meta_trans_with_masks.inc" -#endif - -#define __API_MTWM_COLOUR __API_COLOUR -#define __API_MTWM_INT_TYPE __API_INT_TYPE -#define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -#define __API_MTWM_PIXEL_BLENDING __API_PIXEL_BLENDING -#define __API_MTWM_PIXEL_AVERAGE __API_PIXEL_AVERAGE -#define __API_MTWM_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT -#define __API_MTWM_PIXEL_AVERAGE_INIT __API_PIXEL_AVERAGE_INIT -#define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 -#define __API_MTWM_CFG_SUPPORT_OPACITY 1 - -#define get_pixel_colour_mask get_pixel_colour_src_mask_opa -#define transform_with_mask transform_with_src_mask_and_opacity - -#include "__arm_2d_meta_trans_with_masks.inc" - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ -# define __API_MTWM_COLOUR __API_COLOUR -# define __API_MTWM_INT_TYPE __API_INT_TYPE -# define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -# define __API_MTWM_PIXEL_BLENDING __API_PIXEL_BLENDING -# define __API_MTWM_PIXEL_AVERAGE __API_PIXEL_AVERAGE -# define __API_MTWM_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT -# define __API_MTWM_PIXEL_AVERAGE_INIT __API_PIXEL_AVERAGE_INIT -# define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 -# define __API_MTWM_CFG_SUPPORT_OPACITY 1 -# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define get_pixel_colour_mask get_pixel_colour_src_chn_mask_opa -# define transform_with_mask transform_with_src_chn_mask_and_opacity - -# include "__arm_2d_meta_trans_with_masks.inc" -#endif - - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_INT_TYPE -#undef __API_INT_TYPE_BIT_NUM -#undef __API_PIXEL_BLENDING -#undef __API_PIXEL_AVERAGE -#undef __API_PIXEL_AVERAGE_RESULT -#undef __API_PIXEL_AVERAGE_INIT diff --git a/package/Arm2D/Library/Source/__arm_2d_transform_helium.c b/package/Arm2D/Library/Source/__arm_2d_transform_helium.c deleted file mode 100644 index 78b3d1122..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_transform_helium.c +++ /dev/null @@ -1,1440 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_transform_helium.c - * Description: Acceleration extensions using Helium. - * - * $Date: 12. July 2022 - * $Revision: V.0.1.5 - * - * Target Processor: Cortex-M cores with Helium - * - * -------------------------------------------------------------------- */ - - - -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#ifdef __ARM_2D_COMPILATION_UNIT -#undef __ARM_2D_COMPILATION_UNIT - -#if defined(__ARM_2D_HAS_HELIUM__) && __ARM_2D_HAS_HELIUM__ - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wvector-conversion" -# pragma clang diagnostic ignored "-Wundef" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#endif - - - - -#include "__arm_2d_math_helium.h" -#include "__arm_2d_utils_helium.h" -#ifdef __cplusplus -extern "C" { -#endif - - - - -static -mve_pred16_t arm_2d_is_point_vec_inside_region_s16(const arm_2d_region_t * ptRegion, - const arm_2d_point_s16x8_t * ptPoint) -{ - mve_pred16_t p0 = vcmpgeq(ptPoint->X, ptRegion->tLocation.iX); - p0 = vcmpgeq_m(ptPoint->Y, ptRegion->tLocation.iY, p0); - p0 = vcmpltq_m(ptPoint->X, ptRegion->tLocation.iX + ptRegion->tSize.iWidth, p0); - p0 = vcmpltq_m(ptPoint->Y, ptRegion->tLocation.iY + ptRegion->tSize.iHeight, p0); - - return p0; -} - -static -mve_pred16_t arm_2d_is_point_vec_inside_region_s32(const arm_2d_region_t * ptRegion, - const arm_2d_point_s32x4_t * ptPoint) -{ - mve_pred16_t p0 = vcmpgeq_n_s32(ptPoint->X, ptRegion->tLocation.iX); - p0 = vcmpgeq_m_n_s32(ptPoint->Y, ptRegion->tLocation.iY, p0); - p0 = vcmpltq_m_n_s32(ptPoint->X, ptRegion->tLocation.iX + ptRegion->tSize.iWidth, p0); - p0 = vcmpltq_m_n_s32(ptPoint->Y, ptRegion->tLocation.iY + ptRegion->tSize.iHeight, p0); - - return p0; -} - - -/** - @brief return 3 vector of 16-bit channels (8-bit widened) taken from a memory reference - @param[in] pMem pointer to packed 8-bit channel - @param[out] R vector of 16-bit widened R channel - @param[out] G vector of 16-bit widened G channel - @param[out] B vector of 16-bit widened B channel - */ -void __arm_2d_unpack_rgb888_from_mem(const uint8_t * pMem, uint16x8_t * R, uint16x8_t * G, - uint16x8_t * B) -{ - uint16x8_t sg = vidupq_n_u16(0, 4); - - *R = vldrbq_gather_offset_u16(pMem, sg); - *G = vldrbq_gather_offset_u16(pMem + 1, sg); - *B = vldrbq_gather_offset_u16(pMem + 2, sg); -} - -/** - @brief interleave 3 x 16-bit widened vectors into 8-bit memory reference - (4th channel untouched) - @param[in] pMem pointer to packed 8-bit channel - @param[in] R vector of 16-bit widened R channel - @param[in] G vector of 16-bit widened G channel - @param[in] B vector of 16-bit widened B channel - */ -void __arm_2d_pack_rgb888_to_mem(uint8_t * pMem, uint16x8_t R, uint16x8_t G, uint16x8_t B) -{ - uint16x8_t sg = vidupq_n_u16(0, 4); - - vstrbq_scatter_offset_u16(pMem, sg, vminq(R, vdupq_n_u16(255))); - vstrbq_scatter_offset_u16(pMem + 1, sg, vminq(G, vdupq_n_u16(255))); - vstrbq_scatter_offset_u16(pMem + 2, sg, vminq(B, vdupq_n_u16(255))); - //vstrbq_scatter_offset_u16(pMem + 3, sg, vdupq_n_u16(0)); -} - - - -/* selector for 16-bit vector gather load */ -/* FAR version is been used when offsets involved are above 65535 16-bit words */ -#define FAR_OFFSET _FAR -#define NEAR_OFFSET - - -/** - unpack vectors of 8-bit widened pixels read from a input 2D coordinates if fits inside the region of - interest or alternative target pixel if content matches color mask - (vector of packed pixels & region of interest name implicit and fixed to respectively - vTarget and ptOrigValidRegion) - Update global predictor tracking region fit & color mask comparison. - */ -#define __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_CLR_FAR(/* inputs */ \ - vecX, vecY, pOrigin, ptOrigValidRegion, \ - iOrigStride, MaskColour, vTarget, predTail, \ - /* outputs */ \ - vPixVal, predGlb) \ - arm_2d_point_s16x8_t vPoint = {.X = vecX,.Y = vecY }; \ - /* set vector predicate if point is inside the region */ \ - mve_pred16_t p = \ - arm_2d_is_point_vec_inside_region_s16(ptOrigValidRegion, &vPoint); \ - predGlb |= p; \ - /* prepare vector of point offsets */ \ - int16_t correctionOffset = vminvq_s16(INT16_MAX, vPoint.Y) - 1; \ - uint16x8_t ptOffs = vPoint.X + (vPoint.Y - correctionOffset) * iOrigStride; \ - \ - /* base pointer update to compensate offset */ \ - uint8_t *pOriginCorrected = pOrigin + (correctionOffset * iOrigStride); \ - /* retrieve all point values */ \ - vPixVal = \ - vldrbq_gather_offset_z_u16(pOriginCorrected, ptOffs, predTail & p); \ - \ - /* combine 2 predicates set to true if point is in the region & values */ \ - /* different from color mask */ \ - p = vcmpneq_m_n_u16(vPixVal, MaskColour, p); \ - predGlb |= p; \ - vPixVal = vpselq_u16(vPixVal, vTarget, p); - - - - -/** - unpack vectors of pixels read from a input 2D coordinates if fits inside the region of - interest or alternative target pixel if content matches color mask - (vector of packed pixels & region of interest name implicit and fixed to respectively - vTarget and ptOrigValidRegion) - Update global predictor tracking region fit & color mask comparison. - */ - -#define __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_NOUNPK(/* inputs */ \ - vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTarget, predTail, \ - /* outputs */ \ - ptVal, predGlb) \ - arm_2d_point_s16x8_t vPoint = {.X = vecX,.Y = vecY }; \ - /* set vector predicate if point is inside the region */ \ - mve_pred16_t p = \ - arm_2d_is_point_vec_inside_region_s16(ptOrigValidRegion, &vPoint); \ - \ - /* prepare vector of point offsets */ \ - uint16x8_t ptOffs = vPoint.X + vPoint.Y * iOrigStride; \ - /* retrieve all point values */ \ - ptVal = \ - vldrhq_gather_shifted_offset_z_u16(pOrigin, ptOffs, predTail & p); \ - \ - /* combine 2 predicates set to true if point is in the region & values different from color mask */\ - p = vcmpneq_m_n_u16(ptVal, MaskColour, p); \ - predGlb |= p; \ - ptVal = vpselq_u16(ptVal, vTarget, p); - - - -#define __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT(/* inputs */ \ - vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTarget, predTail, \ - /* outputs */ \ - vPixValR, vPixValG, vPixValB, predGlb) \ - uint16x8_t ptVal; \ - \ - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_NOUNPK(vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTarget, predTail, ptVal, predGlb) \ - /* expand channels */ \ - __arm_2d_rgb565_unpack_single_vec(ptVal, &vPixValR, &vPixValG, &vPixValB); - - - - - -/** - Same as above but use offset compensation during gather load. - unpack vectors of pixels read from a input 2D coordinates if fits inside the region of - interest or alternative target pixel if content matches color mask - (vector of packed pixels & region of interest name implicit and fixed to respectively - vTarget and ptOrigValidRegion) - Update global predictor tracking region fit & color mask comparison. - */ - -#define __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_NOUNPK_FAR( \ - /* inputs */ \ - vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTarget, predTail, \ - /* outputs */ \ - ptVal, predGlb) \ - arm_2d_point_s16x8_t vPoint = {.X = vecX,.Y = vecY }; \ - /* set vector predicate if point is inside the region */ \ - mve_pred16_t p = \ - arm_2d_is_point_vec_inside_region_s16(ptOrigValidRegion, &vPoint); \ - /* prepare vector of point offsets */ \ - int16_t correctionOffset = vminvq_s16(INT16_MAX, vPoint.Y) - 1; \ - uint16x8_t ptOffs = vPoint.X + (vPoint.Y - correctionOffset) * iOrigStride; \ - \ - /* base pointer update to compensate offset */ \ - uint16_t *pOriginCorrected = pOrigin + (correctionOffset * iOrigStride); \ - /* retrieve all point values */ \ - ptVal = \ - vldrhq_gather_shifted_offset_z_u16(pOriginCorrected, ptOffs, predTail & p); \ - \ - /* combine 2 predicates set to true if point is in the region & values different from color mask */\ - p = vcmpneq_m_n_u16(ptVal, MaskColour, p); \ - predGlb |= p; \ - ptVal = vpselq_u16(ptVal, vTarget, p); - - -#define __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_FAR(/* inputs */ \ - vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTarget, predTail, \ - /* outputs */ \ - vPixValR, vPixValG, vPixValB, predGlb) \ - uint16x8_t ptVal; \ - \ - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_NOUNPK_FAR(vecX, vecY, pOrigin, ptOrigValidRegion, \ - iOrigStride, MaskColour, vTarget, predTail, ptVal, predGlb); \ - \ - /* expand channels */ \ - __arm_2d_rgb565_unpack_single_vec(ptVal, &vPixValR, &vPixValG, &vPixValB); - - -/** - unpack vectors of 32-bit pixels read from a input 2D coordinates if fits inside the region of - interest or alternative target pixel if content matches color mask - 16-bit vector processed in 2 parts because of 32-bit requirements, so handles 8 x 32-bit vectors - (vectors of packed pixels & region of interest name implicit and fixed to respectively - vTargetLo, vectorHi and ptOrigValidRegion) - Update 2 global predictors tracking region fit & color mask comparison for 1st and 2nd half. - */ - -#define __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_NOUNPK(/* inputs */ \ - vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTargetLo, vTargetHi, \ - predTailLo, predTailHi, \ - /* outputs */ \ - pointLo, pointHi, predGlbLo, predGlbHi) \ - arm_2d_point_s16x8_t vPoint = {.X = vecX,.Y = vecY }; \ - arm_2d_point_s32x4_t tPointLo, tPointHi; \ - ARM_ALIGN(8) uint32_t scratch32[32]; \ - int16_t *pscratch16 = (int16_t *) scratch32; \ - \ - /* split 16-bit point vector into 2 x 32-bit vectors */ \ - vst1q(pscratch16, vPoint.X); \ - tPointLo.X = vldrhq_s32(pscratch16); \ - tPointHi.X = vldrhq_s32(pscratch16 + 4); \ - \ - vst1q(pscratch16, vPoint.Y); \ - tPointLo.Y = vldrhq_s32(pscratch16); \ - tPointHi.Y = vldrhq_s32(pscratch16 + 4); \ - \ - /* 1st half */ \ - \ - /* set vector predicate if point is inside the region */ \ - mve_pred16_t p = arm_2d_is_point_vec_inside_region_s32(ptOrigValidRegion, &tPointLo); \ - /* prepare vector of point offsets */ \ - uint32x4_t ptOffs = tPointLo.X + tPointLo.Y * iOrigStride; \ - \ - /* retrieve all point values */ \ - pointLo = vldrwq_gather_shifted_offset_z_u32(pOrigin, ptOffs, predTailLo & p); \ - \ - /* combine 2 predicates set to true if point is in the region & values different from color mask */\ - p = vcmpneq_m_n_u32(pointLo, MaskColour, p); \ - predGlbLo |= p; \ - pointLo = vpselq_u32(pointLo, vTargetLo, p); \ - \ - \ - /* 2nd half */ \ - \ - /* set vector predicate if point is inside the region */ \ - p = arm_2d_is_point_vec_inside_region_s32(ptOrigValidRegion, &tPointHi); \ - /* prepare vector of point offsets */ \ - ptOffs = tPointHi.X + tPointHi.Y * iOrigStride; \ - \ - /* retrieve all point values */ \ - pointHi = vldrwq_gather_shifted_offset_z_u32(pOrigin, ptOffs, predTailHi & p); \ - \ - /* combine 2 predicates set to true if point is in the region & values different from color mask */\ - p = vcmpneq_m_n_u32(pointHi, MaskColour, p); \ - predGlbHi |= p; \ - pointHi = vpselq_u32(pointHi, vTargetHi, p); - - -#define __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT(/* inputs */ \ - vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTargetLo, vTargetHi, predTailLo, predTailHi, \ - /* outputs */ \ - vPixValR, vPixValG, vPixValB, predGlbLo, predGlbHi ) \ - \ - uint32x4_t pointLo, pointHi; \ - \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_NOUNPK(vecX, vecY, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTargetLo, vTargetHi, predTailLo, predTailHi, \ - pointLo, pointHi, predGlbLo, predGlbHi) \ - \ - /* expand channels */ \ - vst1q(scratch32, pointLo); \ - vst1q(scratch32 + 4, pointHi); \ - \ - __arm_2d_unpack_rgb888_from_mem((uint8_t *) scratch32, &vPixValR, &vPixValG, &vPixValB); - - - - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - -#define __ARM2D_AVG_NEIGHBR_GRAY8_PIX(/* inputs */ \ - ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTarget, predTail, \ - /* outputs */ \ - predGlb, vAvgPixel) \ - \ - uint16x8_t ptVal8; \ - /* combination of Bottom / Top & Left / Right areas contributions */ \ - __typeof__ (vAvgPixel) vAreaTR, vAreaTL, vAreaBR, vAreaBL; \ - \ - __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, vAreaTR, vAreaTL, vAreaBR, vAreaBL); \ - \ - /* \ - * accumulate / average over the 4 neigbouring pixels \ - */ \ - \ - /* Bottom Left averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_CLR_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, \ - iOrigStride, MaskColour, vTarget, predTail, ptVal8, predGlb); \ - \ - __ARM_2D_SCALE_GRAY8VEC(vAvgPixel, ptVal8, vAreaBL); \ - } \ - \ - /* Bottom Right averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_CLR_FAR(vaddq_n_s16(vXi, 1), vYi, pOrigin, \ - ptOrigValidRegion, iOrigStride, MaskColour, vTarget, predTail, ptVal8, predGlb); \ - \ - __ARM_2D_SCALE_GRAY8VEC_ACC(vAvgPixel, ptVal8, vAreaBR); \ - } \ - \ - /* Top Left averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_CLR_FAR(vXi, vaddq_n_s16(vYi, 1), pOrigin, \ - ptOrigValidRegion, iOrigStride, MaskColour, vTarget, predTail, ptVal8, predGlb); \ - \ - __ARM_2D_SCALE_GRAY8VEC_ACC(vAvgPixel, ptVal8, vAreaTL); \ - } \ - \ - /* Top Right averaging */ \ - { \ - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_CLR_FAR(vaddq_n_s16(vXi, 1), vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, MaskColour, vTarget, predTail, ptVal8, predGlb); \ - \ - __ARM_2D_SCALE_GRAY8VEC_ACC(vAvgPixel, ptVal8, vAreaTR); \ - } - - - -#define __ARM2D_AVG_NEIGHBR_RGB565_PIX(/* inputs */ \ - far, ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTarget, predTail, \ - /* outputs */ \ - predGlb, vAvgPixelR, vAvgPixelG, vAvgPixelB) \ - \ - uint16x8_t R, G, B; \ - __typeof__ (vAvgPixelR) vAreaTR, vAreaTL, vAreaBR, vAreaBL; \ - \ - __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, vAreaTR, vAreaTL, vAreaBR, vAreaBL); \ - \ - \ - /* \ - * accumulate / average over the 4 neigbouring pixels \ - */ \ - \ - /* Bottom Left averaging */ \ - { \ - ARM_CONNECT2(__ARM_2D_RGB565_GET_RGBVEC_FROM_POINT, far)(vXi, vYi, pOrigin, ptOrigValidRegion, \ - iOrigStride, MaskColour,vTarget, predTail, R, G, B, predGlb); \ - \ - __ARM_2D_SCALE_RGBVEC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaBL); \ - } \ - \ - /* Bottom Right averaging */ \ - { \ - ARM_CONNECT2(__ARM_2D_RGB565_GET_RGBVEC_FROM_POINT, far)(vaddq_n_s16(vXi, 1), vYi, \ - pOrigin, ptOrigValidRegion, iOrigStride, MaskColour, vTarget, predTail, R, G, B, predGlb); \ - \ - __ARM_2D_SCALE_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaBR); \ - } \ - \ - /* Top Left averaging */ \ - { \ - ARM_CONNECT2(__ARM_2D_RGB565_GET_RGBVEC_FROM_POINT, far)(vXi, vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, MaskColour, vTarget, predTail, R, G, B, predGlb);\ - \ - __ARM_2D_SCALE_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaTL); \ - } \ - \ - /* Top Right averaging */ \ - { \ - ARM_CONNECT2(__ARM_2D_RGB565_GET_RGBVEC_FROM_POINT, far)(vaddq_n_s16(vXi, 1), vaddq_n_s16(vYi, 1), \ - pOrigin, ptOrigValidRegion, iOrigStride, MaskColour, vTarget, predTail, R, G, B, predGlb);\ - \ - __ARM_2D_SCALE_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaTR); \ - } - - -#define __ARM2D_AVG_NEIGHBR_CCCN888_PIX(/* inputs */ \ - ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTargetLo, vTargetHi, predTailLow, predTailHigh, \ - /* outputs */ \ - predGlbLo, predGlbHi, \ - vAvgPixelR, vAvgPixelG, vAvgPixelB) \ - \ - uint16x8_t R, G, B; \ - __typeof__ (vAvgPixelR) vAreaTR, vAreaTL, vAreaBR, vAreaBL; \ - \ - __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, vAreaTR, vAreaTL, vAreaBR, vAreaBL); \ - \ - /* \ - * accumulate / average over the 4 neigbouring pixels \ - */ \ - \ - /* Bottom Left averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, \ - MaskColour, vTargetLo, vTargetHi, predTailLow, predTailHigh, R, G, B, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_RGBVEC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaBL); \ - } \ - \ - /* Bottom Right averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT(vaddq_n_s16(vXi, 1), vYi, pOrigin, ptOrigValidRegion, \ - iOrigStride, MaskColour, vTargetLo, vTargetHi, predTailLow, predTailHigh, \ - R, G, B, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaBR); \ - } \ - \ - /* Top Left averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT(vXi, vaddq_n_s16(vYi, 1), pOrigin, ptOrigValidRegion, \ - iOrigStride, MaskColour, vTargetLo, vTargetHi, predTailLow, predTailHigh, \ - R, G, B, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaTL); \ - } \ - \ - /* Top Right averaging */ \ - { \ - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT(vaddq_n_s16(vXi, 1), vaddq_n_s16(vYi, 1), pOrigin, \ - ptOrigValidRegion, iOrigStride, MaskColour, vTargetLo, vTargetHi, \ - predTailLow, predTailHigh, R, G, B, predGlbLo, predGlbHi); \ - \ - __ARM_2D_SCALE_RGBVEC_ACC(vAvgPixelR, vAvgPixelG, vAvgPixelB, R, G, B, vAreaTR); \ - } - - -#endif - -#define __ARM_2D_8BIT_RGB_MIX(/* inputs / outputs */ \ - vR_InOut, vG_InOut, vB_InOut, \ - /* inputs */ \ - C1, \ - vR2, vG2, vB2, C2) \ - vR_InOut = vqaddq(vR_InOut * C1, vR2 * C2); \ - vR_InOut = vR_InOut >> 8; \ - \ - vG_InOut = vqaddq(vG_InOut * C1, vG2 * C2); \ - vG_InOut = vG_InOut >> 8; \ - \ - vB_InOut = vqaddq(vB_InOut * C1, vB2 * C2); \ - vB_InOut = vB_InOut >> 8; - - -/** - Alpha blending of a packed vector with 3 vectors of single R, G & B channels - */ - - -#define __ARM_2D_BLEND_RGB565_TARGET_RGBVEC(/* inputs */ \ - hwOpacity, vPackedTarget, vAvgR, vAvgG, vAvgB, \ - /* output */ \ - vBlended) \ - uint16x8_t vTargetR, vTargetG, vTargetB; \ - \ - __arm_2d_rgb565_unpack_single_vec(vTarget, &vTargetR, &vTargetG, &vTargetB); \ - \ - uint16_t transp = 256 - hwOpacity; \ - /* merge */ \ - __ARM_2D_8BIT_RGB_MIX(vAvgR, vAvgG, vAvgB, hwOpacity, \ - vTargetR, vTargetG, vTargetB, transp); \ - \ - vBlended = __arm_2d_rgb565_pack_single_vec(vAvgR, vAvgG, vAvgB); - - - - -#if __ARM_2D_HAS_HELIUM_FLOAT__ \ - && !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - -#define __CALIB 0.009f16 - -/** - Scale Gray8 channel - */ -#define __ARM_2D_SCALE_GRAY8VEC(/* output */ \ - vAvgPix, \ - /* inputs */ \ - vPtVal, vAreaScal) \ - vAvgPix = vAreaScal * vcvtq_f16_u16(vPtVal); - -/** - Scale Gray8 channel with accumulation - */ -#define __ARM_2D_SCALE_GRAY8VEC_ACC(/* input / output */ \ - vAvgPix, \ - /* inputs */ \ - vPtVal, vAreaScal) \ - vAvgPix += vAreaScal * vcvtq_f16_u16(vPtVal); - - -/** - Scale R, G & B channels - */ -#define __ARM_2D_SCALE_RGBVEC(/* outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - /* inputs */ \ - R, G, B, vScal) \ - vAvgPixelR = vScal * vcvtq_f16_u16(R); \ - vAvgPixelG = vScal * vcvtq_f16_u16(G); \ - vAvgPixelB = vScal * vcvtq_f16_u16(B); - - -/** - Scale R, G & B channels with accumulation - */ - -#define __ARM_2D_SCALE_RGBVEC_ACC(/* inputs / outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - /* inputs */ \ - R, G, B, vScal) \ - vAvgPixelR += vScal * vcvtq_f16_u16(R); \ - vAvgPixelG += vScal * vcvtq_f16_u16(G); \ - vAvgPixelB += vScal * vcvtq_f16_u16(B); - - - -#define __ARM_2D_GET_POINT_COORD(point) vcvtq_s16_f16(point) -#define __ARM_2D_CONVERT_TO_PIX_TYP(x) vcvtq_u16_f16(x) - -#define PIX_VEC_TYP float16x8_t -#define ARM_2D_POINT_VEC arm_2d_point_f16x8_t -#define AREA_UNITY 1.0f16 - - -static -bool __arm_2d_transform_regression(arm_2d_size_t * __RESTRICT ptCopySize, - arm_2d_location_t * pSrcPoint, - float fAngle, - float fScale, - arm_2d_location_t * tOffset, - arm_2d_location_t * center, - int32_t iOrigStride, - arm_2d_rot_linear_regr_t regrCoefs[] - ) -{ - int32_t iHeight = ptCopySize->iHeight; - int32_t iWidth = ptCopySize->iWidth; - float invHeight = iHeight > 1 ? 1.0f / (float) (iHeight - 1) : __LARGEINVF32; - arm_2d_point_s32x4_t vPointCornerI; - int32x4_t vCornerX = { 0, 1, 0, 1 }; - int32x4_t vCornerY = { 0, 0, 1, 1 }; - float cosAngle = arm_cos_f32(fAngle) * fScale; - float sinAngle = arm_sin_f32(fAngle) * fScale; - arm_2d_point_float_t centerf; - float slopeX, slopeY; - bool gatherLoadIdxOverflow = 0; - - - centerf.fX = (float) center->iX; - centerf.fY = (float) center->iY; - - vPointCornerI.X = vdupq_n_s32(pSrcPoint->iX + tOffset->iX); - vPointCornerI.X = vPointCornerI.X + vmulq_n_s32(vCornerX, (iWidth - 1)); - - vPointCornerI.Y = vdupq_n_s32(pSrcPoint->iY + tOffset->iY); - vPointCornerI.Y = vPointCornerI.Y + vmulq_n_s32(vCornerY, (iHeight - 1)); - - /* - Vector version of: - - int16_t iX = ptLocation->iX - ptCenter->iX; - int16_t iY = ptLocation->iY - ptCenter->iY; - - float cosAngle = arm_cos_f32(fAngle); - float sinAngle = arm_sin_f32(fAngle); - - ptOutBuffer->fY = (iY * cosAngle + iX * sinAngle + ptCenter->iY); - ptOutBuffer->fX = (-iY * sinAngle + iX * cosAngle + ptCenter->iX); - */ - - arm_2d_point_f32x4_t vTmp, vPointCornerF; - - vTmp.X = vsubq_n_f32(vcvtq_f32_s32(vPointCornerI.X), centerf.fX); - vTmp.Y = vsubq_n_f32(vcvtq_f32_s32(vPointCornerI.Y), centerf.fY); - - vPointCornerF.X = vmulq_n_f32(vTmp.X, cosAngle) - vmulq_n_f32(vTmp.Y, sinAngle); - vPointCornerF.X = vaddq_n_f32(vPointCornerF.X, centerf.fX); - - vPointCornerF.Y = vmulq_n_f32(vTmp.X, sinAngle) + vmulq_n_f32(vTmp.Y, cosAngle); - vPointCornerF.Y = vaddq_n_f32(vPointCornerF.Y, centerf.fY); - - /* - Check whether rotated index offsets could exceed 16-bit limits - used in subsequent gather loads - This will occur for parts of large images (e.g. 320*200) - To avoid unconditional penalties for small/medium images, - returns a speculative overflow allowing to handle large offsets. - */ - float32_t maxY = vmaxnmvq(0.0f, vPointCornerF.Y); - - if((iOrigStride * maxY) > (float)(UINT16_MAX)) - gatherLoadIdxOverflow = true; - - - /* interpolation in Y direction for 1st elements column */ - slopeX = (vPointCornerF.X[2] - vPointCornerF.X[0]) * invHeight; - slopeY = (vPointCornerF.Y[2] - vPointCornerF.Y[0]) * invHeight; - - regrCoefs[0].slopeY = slopeY; - regrCoefs[0].slopeX = slopeX; - regrCoefs[0].interceptY = vPointCornerF.Y[0]; - regrCoefs[0].interceptX = vPointCornerF.X[0]; - - - /* interpolation in Y direction for the last elements column */ - slopeX = (vPointCornerF.X[3] - vPointCornerF.X[1]) * invHeight; - slopeY = (vPointCornerF.Y[3] - vPointCornerF.Y[1]) * invHeight; - - regrCoefs[1].slopeY = slopeY; - regrCoefs[1].slopeX = slopeX; - regrCoefs[1].interceptY = vPointCornerF.Y[1]; - regrCoefs[1].interceptX = vPointCornerF.X[1]; - - return gatherLoadIdxOverflow; -} - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - -#define __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, \ - vAreaTR, vAreaTL, vAreaBR, vAreaBL) \ - float16x8_t vOne = vdupq_n_f16(1.0f); \ - \ - vXi = vsubq_m_n_s16(vXi, vXi, 1, vcmpltq_n_f16(ptPoint->X, 0)); \ - vYi = vsubq_m_n_s16(vYi, vYi, 1, vcmpltq_n_f16(ptPoint->Y, 0)); \ - \ - float16x8_t vWX = ptPoint->X - vcvtq_f16_s16(vXi); \ - float16x8_t vWY = ptPoint->Y - vcvtq_f16_s16(vYi); \ - \ - /* combination of Bottom / Top & Left / Right areas contributions */ \ - vAreaTR = vWX * vWY; \ - vAreaTL = (vOne - vWX) * vWY; \ - vAreaBR = vWX * (vOne - vWY); \ - vAreaBL = (vOne - vWX) * (vOne - vWY); - -#endif - - -#else /* __ARM_2D_HAS_HELIUM_FLOAT__ && ! __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - -/* extra calibration removed in fixed-point code since offset is lower than Q9.6 representation */ - -#define ONE_BY_2PI_Q31 341782637.0f -#define ONE_Q16 UINT16_MAX -#define ARSHIFT(x, shift) (shift > 0 ? x >> shift : x << (-shift)) -#define TO_Q16(x) ((x) << 16) -#define GET_Q6INT(x) ((x) >> 6) -#define SET_Q6INT(x) ((x) << 6) - -/** - Scale Gray8 channel - */ -#define __ARM_2D_SCALE_GRAY8VEC(/* output */ \ - vAvgPix, \ - /* inputs */ \ - vPtVal, vAreaScal) \ - vAvgPix = vrmulhq_u16(vAreaScal, vPtVal); - -/** - Scale Gray8 channel with accumulation - */ -#define __ARM_2D_SCALE_GRAY8VEC_ACC(/* input / output */ \ - vAvgPix, \ - /* inputs */ \ - vPtVal, vAreaScal) \ - vAvgPix = vqaddq(vAvgPix, vrmulhq_u16(vAreaScal, vPtVal)); - - -/** - Scale R, G & B channels - */ -#define __ARM_2D_SCALE_RGBVEC(/* outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - /* inputs */ \ - R, G, B, vScal) \ - vAvgPixelR = vrmulhq_u16(vScal, R); \ - vAvgPixelG = vrmulhq_u16(vScal, G); \ - vAvgPixelB = vrmulhq_u16(vScal, B); - -/** - Scale R, G & B channels with accumulation - */ -#define __ARM_2D_SCALE_RGBVEC_ACC(/* inputs / outputs */ \ - vAvgPixelR, vAvgPixelG, vAvgPixelB, \ - /* inputs */ \ - R, G, B, vScal) \ - vAvgPixelR = vqaddq(vAvgPixelR, vrmulhq_u16(vScal, R)); \ - vAvgPixelG = vqaddq(vAvgPixelG, vrmulhq_u16(vScal, G)); \ - vAvgPixelB = vqaddq(vAvgPixelB, vrmulhq_u16(vScal, B)); - - - -#define __ARM_2D_GET_POINT_COORD(point) GET_Q6INT(point) -#define __ARM_2D_CONVERT_TO_PIX_TYP(x) (x) - -#define PIX_VEC_TYP uint16x8_t -#define ARM_2D_POINT_VEC arm_2d_point_s16x8_t -#define AREA_UNITY vdupq_n_u16(ONE_Q16) - - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - - -#define __ARM2D_GET_NEIGHBR_PIX_AREAS(vXi, vYi, ptPoint, \ - vAreaTR, vAreaTL, vAreaBR, vAreaBL) \ - int16x8_t vOne = vdupq_n_s16(SET_Q6INT(1)); \ - \ - /*vXi = vsubq_m_n_s16(vXi, vXi, 1, vcmpltq_n_s16(ptPoint->X, 0)); */ \ - /*vYi = vsubq_m_n_s16(vYi, vYi, 1, vcmpltq_n_s16(ptPoint->Y, 0)); */ \ - \ - int16x8_t vWX = ptPoint->X - SET_Q6INT(vXi); \ - int16x8_t vWY = ptPoint->Y - SET_Q6INT(vYi); \ - \ - /* combination of Bottom / Top & Left / Right areas contributions */ \ - vAreaTR = vmulq_u16(vWX, vWY); \ - vAreaTL = vmulq_u16((vOne - vWX), vWY); \ - vAreaBR = vmulq_u16(vWX, (vOne - vWY)); \ - vAreaBL = vmulq_u16((vOne - vWX), (vOne - vWY)); \ - \ - /* Q16 conversion */ \ - vAreaTR = vqshlq_n_u16(vAreaTR, 4); \ - vAreaTL = vqshlq_n_u16(vAreaTL, 4); \ - vAreaBR = vqshlq_n_u16(vAreaBR, 4); \ - vAreaBL = vqshlq_n_u16(vAreaBL, 4); - - -#endif - -static -bool __arm_2d_transform_regression(arm_2d_size_t * __RESTRICT ptCopySize, - arm_2d_location_t * pSrcPoint, - float fAngle, - float fScale, - arm_2d_location_t * tOffset, - arm_2d_location_t * center, - int32_t iOrigStride, - arm_2d_rot_linear_regr_t regrCoefs[] - ) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - q31_t invHeightFx = iHeight > 1 ? INT32_MAX / (iHeight - 1) : INT32_MAX; - int32_t AngleFx = lroundf(fAngle * ONE_BY_2PI_Q31); - int32_t ScaleFx = (int32_t)((float)fScale * (float)TO_Q16(1)); - q31_t cosAngleFx = MULTFX(arm_cos_q31(AngleFx), ScaleFx); - q31_t sinAngleFx = MULTFX(arm_sin_q31(AngleFx), ScaleFx); - arm_2d_point_fx_t tPointCornerFx[2][2]; - arm_2d_point_fx_t centerQ16; - arm_2d_point_fx_t srcPointQ16; - arm_2d_point_fx_t tOffsetQ16; - arm_2d_point_fx_t tmp; - int32_t iXQ16, iYQ16; - bool gatherLoadIdxOverflow = 0; - - /* Q16 conversion */ - centerQ16.X = TO_Q16(center->iX); - centerQ16.Y = TO_Q16(center->iY); - - srcPointQ16.X = TO_Q16(pSrcPoint->iX); - srcPointQ16.Y = TO_Q16(pSrcPoint->iY); - - tOffsetQ16.X = TO_Q16(tOffset->iX); - tOffsetQ16.Y = TO_Q16(tOffset->iY); - - - /* (0,0) corner */ - tmp.X = srcPointQ16.X + 0 + tOffsetQ16.X; - tmp.Y = srcPointQ16.Y + 0 + tOffsetQ16.Y; - - iXQ16 = tmp.X - centerQ16.X; - iYQ16 = tmp.Y - centerQ16.Y; - - tPointCornerFx[0][0].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[0][0].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - - /* ((iWidth - 1),0) corner */ - tmp.X = srcPointQ16.X + 0 + tOffsetQ16.X + TO_Q16(iWidth - 1); - iXQ16 = tmp.X - centerQ16.X; - - tPointCornerFx[1][0].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[1][0].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - - /* ((iWidth - 1),(iHeight - 1)) corner */ - tmp.Y = srcPointQ16.Y + tOffsetQ16.Y + TO_Q16(iHeight - 1); - iYQ16 = tmp.Y - centerQ16.Y; - - tPointCornerFx[1][1].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[1][1].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - - /* (0,(iHeight - 1)) corner */ - tmp.X = srcPointQ16.X + 0 + tOffsetQ16.X; - iXQ16 = tmp.X - centerQ16.X; - - tPointCornerFx[0][1].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[0][1].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - /* - Check whether rotated index offsets could exceed 16-bit limits - used in subsequent gather loads - This will occur for parts of large images (e.g. 320*200) - To avoid unconditional penalties for small/medium images, - returns a speculative overflow allowing to handle large offsets. - */ - int32_t maxY = MAX(MAX - (MAX(tPointCornerFx[0][0].Y, tPointCornerFx[0][1].Y), - tPointCornerFx[1][0].Y), - tPointCornerFx[1][1].Y); - - if(MULTFX(TO_Q16(iOrigStride), maxY) > UINT16_MAX) - gatherLoadIdxOverflow = true; - - - /* regression */ - int32_t slopeXFx, slopeYFx; - - /* interpolation in Y direction for 1st elements column */ - slopeXFx = MULTFX((tPointCornerFx[0][1].X - tPointCornerFx[0][0].X), invHeightFx); - slopeYFx = MULTFX((tPointCornerFx[0][1].Y - tPointCornerFx[0][0].Y), invHeightFx); - - regrCoefs[0].slopeY = slopeYFx * 2; - regrCoefs[0].slopeX = slopeXFx * 2; - regrCoefs[0].interceptY = tPointCornerFx[0][0].Y; - regrCoefs[0].interceptX = tPointCornerFx[0][0].X; - - - /* interpolation in Y direction for the last elements column */ - slopeXFx = MULTFX((tPointCornerFx[1][1].X - tPointCornerFx[1][0].X), invHeightFx); - slopeYFx = MULTFX((tPointCornerFx[1][1].Y - tPointCornerFx[1][0].Y), invHeightFx); - - regrCoefs[1].slopeY = slopeYFx* 2; - regrCoefs[1].slopeX = slopeXFx* 2; - regrCoefs[1].interceptY = tPointCornerFx[1][0].Y; - regrCoefs[1].interceptX = tPointCornerFx[1][0].X; - - return gatherLoadIdxOverflow; -} -#endif // __ARM_2D_HAS_HELIUM_FLOAT__ - - - -static -void __MVE_WRAPPER( __arm_2d_impl_gray8_get_pixel_colour)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint8_t * pOrigin, - int16_t iOrigStride, - uint8_t * pTarget, uint8_t MaskColour, uint32_t elts) -{ - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vldrbq_u16(pTarget); - - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - /* accumulated pixel vectors */ - uint16x8_t vDstPixel; - - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixel; - - __ARM2D_AVG_NEIGHBR_GRAY8_PIX(ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTarget, predTail, predGlb, vAvgPixel); - - vDstPixel = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixel); - - /* saturate to 8-bit */ - vDstPixel = vminq(vDstPixel, vdupq_n_u16(255)); - } -#else - { - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_CLR_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, MaskColour, vTarget, predTail, - vDstPixel, predGlb); - } -#endif - - /* select between target pixel, averaged pixed */ - vTarget = vpselq_u16(vDstPixel, vTarget, predGlb); - - vstrbq_p_u16(pTarget, vTarget, predTail); -} - - - - -static -void __MVE_WRAPPER( __arm_2d_impl_gray8_get_pixel_colour_with_alpha)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint8_t * pOrigin, - int16_t iOrigStride, - uint8_t * pTarget, - uint8_t MaskColour, - uint_fast16_t hwOpacity, uint32_t elts) -{ - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vldrbq_u16(pTarget); - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - uint16x8_t vDstPixel; - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixel; - - __ARM2D_AVG_NEIGHBR_GRAY8_PIX(ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTarget, predTail, predGlb, vAvgPixel); - - vDstPixel = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixel); - } -#else - { - __ARM_2D_GRAY8_GET_PIXVEC_FROM_POINT_MASK_CLR_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, MaskColour, vTarget, predTail, - vDstPixel, predGlb); - } -#endif - - /* blending */ - uint16_t hwTransparency = 256 - hwOpacity; - uint16x8_t vBlended = - vqaddq(vDstPixel * (uint16_t) hwOpacity, vTarget * hwTransparency) >> 8; - - /* select between target pixel, averaged pixed */ - vTarget = vpselq_u16(vBlended, vTarget, predGlb); - - vstrbq_p_u16(pTarget, vTarget, predTail); -} - - -static -void __MVE_WRAPPER( __arm_2d_impl_rgb565_get_pixel_colour)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint16_t * pOrigin, - int16_t iOrigStride, - uint16_t * pTarget, uint16_t MaskColour, uint32_t elts) -{ - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vld1q(pTarget); - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - uint16x8_t vDstPixel; - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - - __ARM2D_AVG_NEIGHBR_RGB565_PIX(NEAR_OFFSET, ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, MaskColour, vTarget, predTail, predGlb, vAvgPixelR, - vAvgPixelG, vAvgPixelB); - - /* pack */ - vDstPixel = __arm_2d_rgb565_pack_single_vec(__ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR), - __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG), - __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB)); - } -#else - { - - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_NOUNPK(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTarget, predTail, vDstPixel, predGlb ); - } -#endif - - vTarget = vpselq_u16(vDstPixel, vTarget, predGlb); - - /* update target pixels */ - vst1q_p(pTarget, vTarget, predTail); -} - - - - -static -void __MVE_WRAPPER( __arm_2d_impl_rgb565_get_pixel_colour_offs_compensated)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint16_t * pOrigin, - int16_t iOrigStride, - uint16_t * pTarget, uint16_t MaskColour, uint32_t elts) -{ - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vld1q(pTarget); - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - uint16x8_t vDstPixel; - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - - __ARM2D_AVG_NEIGHBR_RGB565_PIX(FAR_OFFSET, ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, MaskColour, vTarget, predTail, predGlb, vAvgPixelR, - vAvgPixelG, vAvgPixelB); - - /* pack */ - vDstPixel = __arm_2d_rgb565_pack_single_vec(__ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR), - __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG), - __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB)); - } -#else - { - - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_NOUNPK_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTarget, predTail, vDstPixel, predGlb); - } -#endif - - vTarget = vpselq_u16(vDstPixel, vTarget, predGlb); - - /* update target pixels */ - vst1q_p(pTarget, vTarget, predTail); -} - - - -static -void __MVE_WRAPPER( __arm_2d_impl_rgb565_get_pixel_colour_with_alpha)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint16_t * pOrigin, - int16_t iOrigStride, - uint16_t * pTarget, - uint16_t MaskColour, - uint_fast16_t hwOpacity, uint32_t elts) -{ - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vld1q(pTarget); - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - uint16x8_t vAvgR, vAvgG, vAvgB; - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - - __ARM2D_AVG_NEIGHBR_RGB565_PIX(NEAR_OFFSET, ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, MaskColour, vTarget, predTail, predGlb, vAvgPixelR, - vAvgPixelG, vAvgPixelB); - - vAvgR = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR); - vAvgG = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG); - vAvgB = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB); - } -#else - { - - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTarget, predTail, vAvgR, vAvgG, vAvgB, predGlb ); - } -#endif - /* blending */ - - uint16x8_t vBlended; - - __ARM_2D_BLEND_RGB565_TARGET_RGBVEC((uint16_t) hwOpacity, vTarget, vAvgR, vAvgG, vAvgB, - vBlended); - - /* select between target pixel, averaged pixed */ - vTarget = vpselq_u16(vBlended, vTarget, predGlb); - - vst1q_p(pTarget, vTarget, predTail); -} - - -static -void __MVE_WRAPPER( __arm_2d_impl_rgb565_get_pixel_colour_with_alpha_offs_compensated)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint16_t * pOrigin, - int16_t iOrigStride, - uint16_t * pTarget, - uint16_t MaskColour, - uint_fast16_t hwOpacity, uint32_t elts) -{ - mve_pred16_t predTail = vctp16q(elts); - uint16x8_t vTarget = vld1q(pTarget); - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - uint16x8_t vAvgR, vAvgG, vAvgB; - /* predicate accumulator */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlb = 0; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - - __ARM2D_AVG_NEIGHBR_RGB565_PIX(FAR_OFFSET, ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, - iOrigStride, MaskColour, vTarget, predTail, predGlb, vAvgPixelR, - vAvgPixelG, vAvgPixelB); - - vAvgR = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR); - vAvgG = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG); - vAvgB = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB); - } -#else - { - __ARM_2D_RGB565_GET_RGBVEC_FROM_POINT_FAR(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTarget, predTail, vAvgR, vAvgG, vAvgB, predGlb ); - } -#endif - /* blending */ - - uint16x8_t vBlended; - - __ARM_2D_BLEND_RGB565_TARGET_RGBVEC((uint16_t) hwOpacity, vTarget, vAvgR, vAvgG, vAvgB, - vBlended); - - /* select between target pixel, averaged pixed */ - vTarget = vpselq_u16(vBlended, vTarget, predGlb); - - vst1q_p(pTarget, vTarget, predTail); -} - - - - -static -void __MVE_WRAPPER( __arm_2d_impl_cccn888_get_pixel_colour)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint32_t * pOrigin, - int16_t iOrigStride, - uint32_t * pTarget, uint32_t MaskColour, int16_t elts) -{ - - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - - uint32x4_t vTargetLo = vld1q(pTarget); - uint32x4_t vTargetHi = vld1q(pTarget + 4); - mve_pred16_t predTailLow = vctp32q(elts); - mve_pred16_t predTailHigh = elts - 4 > 0 ? vctp32q(elts - 4) : 0; - - /* predicate accumulators */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlbLo = 0, predGlbHi = 0; - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - - - __ARM2D_AVG_NEIGHBR_CCCN888_PIX(ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTargetLo, vTargetHi, predTailLow, predTailHigh, - predGlbLo, predGlbHi, - vAvgPixelR, vAvgPixelG, vAvgPixelB); - - { - ARM_ALIGN(8) uint32_t scratch32[32]; - /* pack */ - __arm_2d_pack_rgb888_to_mem((uint8_t *) scratch32, __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR), - __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG), __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB)); - - uint32x4_t TempPixel = vld1q(scratch32); - - /* select between target pixel, averaged pixed */ - TempPixel = vpselq_u32(TempPixel, vTargetLo, predGlbLo); - - vst1q_p(pTarget, TempPixel, predTailLow); - - TempPixel = vld1q(scratch32 + 4); - - /* select between target pixel, averaged pixed */ - TempPixel = vpselq_u32(TempPixel, vTargetHi, predGlbHi); - - vst1q_p(pTarget + 4, TempPixel, predTailHigh); - } - } -#else - { - uint32x4_t pointLo, pointHi; - - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT_NOUNPK(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTargetLo, vTargetHi, predTailLow, predTailHigh, pointLo, pointHi, predGlbLo, predGlbHi); - - uint32x4_t vPixel = vpselq_u32(pointLo, vTargetLo, predGlbLo); - - vst1q_p(pTarget, vPixel, predTailLow); - - vPixel = vpselq_u32(pointHi, vTargetHi, predGlbHi); - - vst1q_p(pTarget + 4, vPixel, predTailHigh); - } -#endif -} - - - -static -void __MVE_WRAPPER( __arm_2d_impl_cccn888_get_pixel_colour_with_alpha)(ARM_2D_POINT_VEC * ptPoint, - arm_2d_region_t * ptOrigValidRegion, - uint32_t * pOrigin, - int16_t iOrigStride, - uint32_t * pTarget, - uint32_t MaskColour, - uint_fast16_t hwOpacity, int16_t elts) -{ - int16x8_t vXi = __ARM_2D_GET_POINT_COORD(ptPoint->X); - int16x8_t vYi = __ARM_2D_GET_POINT_COORD(ptPoint->Y); - - uint32x4_t vTargetLo = vld1q(pTarget); - uint32x4_t vTargetHi = vld1q(pTarget + 4); - mve_pred16_t predTailLow = vctp32q(elts); - mve_pred16_t predTailHigh = elts - 4 > 0 ? vctp32q(elts - 4) : 0; - uint16x8_t vAvgR, vAvgG, vAvgB; - - - /* predicate accumulators */ - /* tracks all predications conditions for selecting final */ - /* averaged pixed / target pixel */ - mve_pred16_t predGlbLo = 0, predGlbHi = 0; - - -#if defined(__ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__) && __ARM_2D_HAS_ANTI_ALIAS_TRANSFORM__ - { - /* accumulated pixel vectors */ - PIX_VEC_TYP vAvgPixelR, vAvgPixelG, vAvgPixelB; - - __ARM2D_AVG_NEIGHBR_CCCN888_PIX(ptPoint, vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, - MaskColour, vTargetLo, vTargetHi, predTailLow, predTailHigh, - predGlbLo, predGlbHi, - vAvgPixelR, vAvgPixelG, - vAvgPixelB); - vAvgR = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelR); - vAvgG = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelG); - vAvgB = __ARM_2D_CONVERT_TO_PIX_TYP(vAvgPixelB); - } -#else - { - uint16x8_t R, G, B; - - __ARM_2D_RGB888_GET_RGBVEC_FROM_POINT(vXi, vYi, pOrigin, ptOrigValidRegion, iOrigStride, MaskColour, vTargetLo, - vTargetHi, predTailLow, predTailHigh, R, G, B, predGlbLo, predGlbHi); - - vAvgR = R; - vAvgG = G; - vAvgB = B; - } -#endif - - - /* alpha blending */ - uint16x8_t vTargetR, vTargetG, vTargetB; - uint16_t transp = 256 - hwOpacity; - ARM_ALIGN(8) uint32_t scratch32[32]; - - __arm_2d_unpack_rgb888_from_mem((const uint8_t *) pTarget, &vTargetR, &vTargetG, &vTargetB); - - /* merge */ - __ARM_2D_8BIT_RGB_MIX(vAvgR, vAvgG, vAvgB, (uint16_t) hwOpacity, - vTargetR, vTargetG, vTargetB, transp); - - /* pack */ - __arm_2d_pack_rgb888_to_mem((uint8_t *) scratch32, vAvgR, vAvgG, vAvgB); - - uint32x4_t TempPixel = vld1q(scratch32); - - /* select between target pixel, averaged pixed */ - TempPixel = vpselq_u32(TempPixel, vTargetLo, predGlbLo); - - vst1q_p(pTarget, TempPixel, predTailLow); - - TempPixel = vld1q(scratch32 + 4); - - /* select between target pixel, averaged pixed */ - TempPixel = vpselq_u32(TempPixel, vTargetHi, predGlbHi); - - vst1q_p(pTarget + 4, TempPixel, predTailHigh); -} - - -/* - * Src mask variants expansion - * - * - transform_with_src_chn_mask_and_opacity - * - transform_with_src_mask_and_opacity - * - transform_with_src_chn_mask - * - transform_with_src_mask - */ - - -#define __API_INT_TYPE_BIT_NUM 8 -#define __API_COLOUR ARM_2D_M_COLOUR_GRAY8 -#define __API_COLOUR_NAME gray8 - - -#include "__arm_2d_transform_helium.inc" - -#define __API_INT_TYPE_BIT_NUM 16 -#define __API_COLOUR ARM_2D_M_COLOUR_RGB565 -#define __API_COLOUR_NAME rgb565 - -#include "__arm_2d_transform_helium.inc" - -#define __API_INT_TYPE_BIT_NUM 32 -#define __API_COLOUR ARM_2D_M_COLOUR_CCCN888 -#define __API_COLOUR_NAME cccn888 - -#include "__arm_2d_transform_helium.inc" - - -#ifdef __cplusplus -} -#endif - -#endif // __ARM_2D_HAS_HELIUM__ - -#endif // __ARM_2D_COMPILATION_UNIT diff --git a/package/Arm2D/Library/Source/__arm_2d_transform_helium.inc b/package/Arm2D/Library/Source/__arm_2d_transform_helium.inc deleted file mode 100644 index ed4094f20..000000000 --- a/package/Arm2D/Library/Source/__arm_2d_transform_helium.inc +++ /dev/null @@ -1,701 +0,0 @@ - -/* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: __arm_2d_transform_helium.inc - * Description: c code template for transform - * - * $Date: 12. July 2022 - * $Revision: V.1.0.4 - * - * -------------------------------------------------------------------- */ - -#ifndef __API_INT_TYPE_BIT_NUM -# error You have to define __API_INT_TYPE_BIT_NUM before using this c template -#endif -#ifndef __API_COLOUR -# error You have to define __API_COLOUR before using this c template -#endif -#ifndef __API_COLOUR_NAME -# error You have to define __API_COLOUR_NAME before using this c template -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#define ____ARM_2D_FUNC(__NAME, __COLOUR) __MVE_WRAPPER(__arm_2d_impl_##__COLOUR##_##__NAME) -#define ___ARM_2D_FUNC(__NAME, __COLOUR) ____ARM_2D_FUNC(__NAME, __COLOUR) -#define __ARM_2D_FUNC(__NAME) ___ARM_2D_FUNC(__NAME, __API_COLOUR_NAME) - - - -#define __API_INT_TYPE ARM_PIX_SCLTYP(__API_INT_TYPE_BIT_NUM) - -#define MASK_COLOR(sz) (sz == 8) ? ptInfo->Mask.chColour : ((sz == 16) ? ptInfo->Mask.hwColour : ptInfo->Mask.wColour) - - -#if !__ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - - float32_t invIWidth = iWidth > 1 ? 1.0f / (float32_t) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - - /* slopes between 1st and last columns */ - float32_t slopeY, slopeX; - - slopeY = (float32_t) (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (float32_t) (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { -#endif - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float32_t colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - - #if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); - #endif - __ARM_2D_FUNC(get_pixel_colour)(&tPointV, - &ptParam->tOrigin.tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, MaskColour, - nbVecElts); - - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - } else { - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = regrCoefs[0].slopeY * y + regrCoefs[0].interceptY; - float32_t colFirstX = regrCoefs[0].slopeX * y + regrCoefs[0].interceptX; - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - uint16_t *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __MVE_WRAPPER(__arm_2d_impl_rgb565_get_pixel_colour_offs_compensated)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - MaskColour, - nbVecElts); - - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform_with_opacity)(__arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - float32_t invIWidth = iWidth > 1 ? 1.0f / (float32_t) (iWidth - 1) : __LARGEINVF32; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - /* slopes between 1st and last columns */ - float32_t slopeY, slopeX; - - slopeY = (float32_t) (regrCoefs[1].interceptY - regrCoefs[0].interceptY) * invIWidth; - slopeX = (float32_t) (regrCoefs[1].interceptX - regrCoefs[0].interceptX) * invIWidth; - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { -#endif - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = - (regrCoefs[0].slopeY * y + regrCoefs[0].interceptY); - float32_t colFirstX = - (regrCoefs[0].slopeX * y + regrCoefs[0].interceptX); - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __ARM_2D_FUNC(get_pixel_colour_with_alpha)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, iOrigStride, - pTargetBaseCur, - MaskColour, - hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - } else { - - /* - Large image / Large origin offsets - Gather load 16-bit could overflow - - Y offset needs to be shifted down to avoid overflow - - 16-bit gather loads base address is incremented - - Needs to be done in the inner loop. - In the case of steep slopes, taking the minimum between the Y extrema could still generate overflows - */ - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates (intercepts for regression in X direction */ - float32_t colFirstY = - (regrCoefs[0].slopeY * y + regrCoefs[0].interceptY); - float32_t colFirstX = - (regrCoefs[0].slopeX * y + regrCoefs[0].interceptX); - - int32_t nbVecElts = iWidth; - float16x8_t vX = vcvtq_f16_s16((int16x8_t) vidupq_n_u16(0, 1)); - uint16_t *pTargetBaseCur = pTargetBase; - - while (nbVecElts > 0) { - arm_2d_point_f16x8_t tPointV; - - /* linear interpolation thru first & last columns */ - tPointV.X = - vfmaq_n_f16(vdupq_n_f16(colFirstX), vX, slopeX); - tPointV.Y = - vfmaq_n_f16(vdupq_n_f16(colFirstY), vX, slopeY); - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_ROTATION_FOR_PERFORMANCE__) - tPointV.X = vaddq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpgtq(tPointV.X, 0)); - tPointV.X = vsubq_m_n_f16(tPointV.X, tPointV.X, __CALIB, vcmpleq(tPointV.X, 0)); - - tPointV.Y = vaddq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpgtq(tPointV.Y, 0)); - tPointV.Y = vsubq_m_n_f16(tPointV.Y, tPointV.Y, __CALIB, vcmpleq(tPointV.Y, 0)); -#endif - __MVE_WRAPPER(__arm_2d_impl_rgb565_get_pixel_colour_with_alpha_offs_compensated)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - MaskColour, - hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += 8.0f16; - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - - -#else /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float32_t fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - q31_t invIWidth = (iWidth > 1) ? 0x7fffffff / (iWidth - 1) : 0x7fffffff; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - - /* slopes between 1st and last columns */ - int32_t slopeY, slopeX; - - slopeY = - MULTFX((regrCoefs[1].interceptY - regrCoefs[0].interceptY), invIWidth); - slopeX = - MULTFX((regrCoefs[1].interceptX - regrCoefs[0].interceptX), invIWidth); - - int32_t nrmSlopeX = 17 - __CLZ(ABS(slopeX)); - int32_t nrmSlopeY = 17 - __CLZ(ABS(slopeY)); - - slopeX = ARSHIFT(slopeX, nrmSlopeX); - slopeY = ARSHIFT(slopeY, nrmSlopeY); - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { - -#endif - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - /* Q6 conversion */ - colFirstX = colFirstX >> 10; - colFirstY = colFirstY >> 10; - - int32_t nbVecElts = iWidth; - int16x8_t vX = (int16x8_t) vidupq_n_u16(0, 1); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - /* Q9.6 coversion */ - vX = SET_Q6INT(vX); - - while (nbVecElts > 0) { - arm_2d_point_s16x8_t tPointV; - - tPointV.X = vqdmulhq_n_s16(vX, slopeX); - tPointV.X = vaddq_n_s16(vqrshlq_n_s16(tPointV.X, nrmSlopeX), colFirstX); - - tPointV.Y = vqdmulhq_n_s16(vX, slopeY); - tPointV.Y = vaddq_n_s16(vqrshlq_n_s16(tPointV.Y, nrmSlopeY), colFirstY); - - __ARM_2D_FUNC(get_pixel_colour)(&tPointV, - &ptParam->tOrigin.tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, MaskColour, - nbVecElts); - - pTargetBaseCur += 8; - vX += ((1<<6) * 8); - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - /* RGB565 specific */ - } else { - for (int32_t y = 0; y < iHeight; y++) { - - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - /* Q6 conversion */ - colFirstX = colFirstX >> 10; - colFirstY = colFirstY >> 10; - - int32_t nbVecElts = iWidth; - int16x8_t vX = (int16x8_t) vidupq_n_u16(0, 1); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - /* Q9.6 coversion */ - vX = SET_Q6INT(vX); - - while (nbVecElts > 0) { - arm_2d_point_s16x8_t tPointV; - - tPointV.X = vqdmulhq_n_s16(vX, slopeX); - tPointV.X = vaddq_n_s16(vqrshlq_n_s16(tPointV.X, nrmSlopeX), colFirstX); - - tPointV.Y = vqdmulhq_n_s16(vX, slopeY); - tPointV.Y = vaddq_n_s16(vqrshlq_n_s16(tPointV.Y, nrmSlopeY), colFirstY); - - __MVE_WRAPPER(__arm_2d_impl_rgb565_get_pixel_colour_offs_compensated)(&tPointV, - &ptParam->tOrigin. - tValidRegion, - pOrigin, - iOrigStride, - pTargetBaseCur, - MaskColour, - nbVecElts); - - pTargetBaseCur += 8; - vX += SET_Q6INT(8); - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - - - - -__OVERRIDE_WEAK -void __ARM_2D_FUNC(transform_with_opacity)( __arm_2d_param_copy_orig_t *ptParam, - __arm_2d_transform_info_t *ptInfo, - uint_fast16_t hwRatio) -{ - int32_t iHeight = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iHeight; - int32_t iWidth = ptParam->use_as____arm_2d_param_copy_t.tCopySize.iWidth; - - int32_t iTargetStride = - ptParam->use_as____arm_2d_param_copy_t.tTarget.iStride; - __API_INT_TYPE *pTargetBase = ptParam->use_as____arm_2d_param_copy_t.tTarget.pBuffer; - __API_INT_TYPE *pOrigin = ptParam->tOrigin.pBuffer; - int32_t iOrigStride = ptParam->tOrigin.iStride; - __API_INT_TYPE MaskColour = MASK_COLOR(__API_INT_TYPE_BIT_NUM); - float fAngle = -ptInfo->fAngle; - arm_2d_location_t tOffset = - ptParam->use_as____arm_2d_param_copy_t.tSource.tValidRegion.tLocation; - arm_2d_location_t *pCenter = &(ptInfo->tCenter); - - q31_t invIWidth = iWidth > 1 ? 0x7fffffff / (iWidth - 1) : 0x7fffffff; - arm_2d_rot_linear_regr_t regrCoefs[2]; - arm_2d_location_t SrcPt = ptInfo->tDummySourceOffset; -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - /* get regression parameters over 1st and last column */ -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - bool gatherLoadIdxOverflow; - gatherLoadIdxOverflow = -#endif - __arm_2d_transform_regression( - &ptParam->use_as____arm_2d_param_copy_t.tCopySize, - &SrcPt, - fAngle, - ptInfo->fScale, - &tOffset, - pCenter, - iOrigStride, - regrCoefs); - - - /* slopes between 1st and last columns */ - int32_t slopeY, slopeX; - - slopeY = MULTFX((regrCoefs[1].interceptY - regrCoefs[0].interceptY), invIWidth); - slopeX = MULTFX((regrCoefs[1].interceptX - regrCoefs[0].interceptX), invIWidth); - - int32_t nrmSlopeX = 17 - __CLZ(ABS(slopeX)); - int32_t nrmSlopeY = 17 - __CLZ(ABS(slopeY)); - - slopeX = ARSHIFT(slopeX, nrmSlopeX); - slopeY = ARSHIFT(slopeY, nrmSlopeY); - -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - if (!gatherLoadIdxOverflow) { -#endif - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - /* Q6 conversion */ - colFirstX = colFirstX >> 10; - colFirstY = colFirstY >> 10; - - int32_t nbVecElts = iWidth; - int16x8_t vX = (int16x8_t) vidupq_n_u16(0, 1); - __API_INT_TYPE *pTargetBaseCur = pTargetBase; - - /* Q9.6 coversion */ - vX = SET_Q6INT(vX); - - while (nbVecElts > 0) { - /* interpolation */ - arm_2d_point_s16x8_t tPointV; - - tPointV.X = vqdmulhq_n_s16(vX, slopeX); - tPointV.X = vaddq_n_s16(vqrshlq_n_s16(tPointV.X, nrmSlopeX), colFirstX); - - tPointV.Y = vqdmulhq_n_s16(vX, slopeY); - tPointV.Y = vaddq_n_s16(vqrshlq_n_s16(tPointV.Y, nrmSlopeY), colFirstY); - - __ARM_2D_FUNC(get_pixel_colour_with_alpha)(&tPointV, - &ptParam->tOrigin.tValidRegion, - pOrigin, iOrigStride, - pTargetBaseCur, - MaskColour, hwRatio, - nbVecElts); - pTargetBaseCur += 8; - vX += SET_Q6INT(8); - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } -#if __API_COLOUR == ARM_2D_M_COLOUR_RGB565 - } else { - /* - Large image / Large origin offsets - Gather load 16-bit could overflow - - Y offset needs to be shifted down to avoid overflow - - 16-bit gather loads base address is incremented - - Needs to be done in the inner loop. - In the case of steep slopes, taking the minimum between the Y extrema could still generate overflows - */ - for (int32_t y = 0; y < iHeight; y++) { - /* 1st column estimates */ - int32_t colFirstY = - __QADD((regrCoefs[0].slopeY * y), regrCoefs[0].interceptY); - int32_t colFirstX = - __QADD((regrCoefs[0].slopeX * y), regrCoefs[0].interceptX); - - /* Q6 conversion */ - colFirstX = colFirstX >> 10; - colFirstY = colFirstY >> 10; - - int32_t nbVecElts = iWidth; - int16x8_t vX = (int16x8_t) vidupq_n_u16(0, 1); - uint16_t *pTargetBaseCur = pTargetBase; - - /* Q9.6 coversion */ - vX = SET_Q6INT(vX); - - while (nbVecElts > 0) { - /* interpolation */ - arm_2d_point_s16x8_t tPointV; - - tPointV.X = vqdmulhq_n_s16(vX, slopeX); - tPointV.X = vaddq_n_s16(vqrshlq_n_s16(tPointV.X, nrmSlopeX), colFirstX); - - tPointV.Y = vqdmulhq_n_s16(vX, slopeY); - tPointV.Y = vaddq_n_s16(vqrshlq_n_s16(tPointV.Y, nrmSlopeY), colFirstY); - - __MVE_WRAPPER(__arm_2d_impl_rgb565_get_pixel_colour_with_alpha_offs_compensated) - (&tPointV, &ptParam->tOrigin.tValidRegion, pOrigin, iOrigStride, - pTargetBaseCur, MaskColour, hwRatio, nbVecElts); - - pTargetBaseCur += 8; - vX += SET_Q6INT(8); - nbVecElts -= 8; - } - pTargetBase += iTargetStride; - } - } -#endif -} - - -#endif /* __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ */ - - -#define __API_MTWM_COLOUR __API_COLOUR -#define __API_MTWM_COLOUR_NAME __API_COLOUR_NAME -#define __API_MTWM_INT_TYPE __API_INT_TYPE -#define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -#define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 - -#define get_pixel_colour_mask get_pixel_colour_src_mask -#define transform_with_mask transform_with_src_mask - -#include "__arm_2d_meta_trans_with_masks_helium.inc" - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ -# define __API_MTWM_COLOUR __API_COLOUR -# define __API_MTWM_COLOUR_NAME __API_COLOUR_NAME -# define __API_MTWM_INT_TYPE __API_INT_TYPE -# define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -# define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 -# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 -# define get_pixel_colour_mask get_pixel_colour_src_chn_mask -# define transform_with_mask transform_with_src_chn_mask - -# include "__arm_2d_meta_trans_with_masks_helium.inc" -#endif - -#define __API_MTWM_COLOUR __API_COLOUR -#define __API_MTWM_COLOUR_NAME __API_COLOUR_NAME -#define __API_MTWM_INT_TYPE __API_INT_TYPE -#define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -#define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 -#define __API_MTWM_CFG_SUPPORT_OPACITY 1 - -#define get_pixel_colour_mask get_pixel_colour_src_mask_opa -#define transform_with_mask transform_with_src_mask_and_opacity - -#include "__arm_2d_meta_trans_with_masks_helium.inc" - - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ -# define __API_MTWM_COLOUR __API_COLOUR -# define __API_MTWM_COLOUR_NAME __API_COLOUR_NAME -# define __API_MTWM_INT_TYPE __API_INT_TYPE -# define __API_MTWM_INT_TYPE_BIT_NUM __API_INT_TYPE_BIT_NUM -# define __API_MTWM_CFG_SUPPORT_SOURCE_MASK 1 -# define __API_MTWM_CFG_SUPPORT_OPACITY 1 -# define __API_MTWM_CFG_CHANNEL_8in32_SUPPORT_ON_SOURCE_SIDE 1 - -# define get_pixel_colour_mask get_pixel_colour_src_chn_mask_opa -# define transform_with_mask transform_with_src_chn_mask_and_opacity - -# include "__arm_2d_meta_trans_with_masks_helium.inc" -#endif - -#undef ____ARM_2D_FUNC -#undef ___ARM_2D_FUNC -#undef __ARM_2D_FUNC -#undef __API_COLOUR -#undef __API_COLOUR_NAME -#undef __API_INT_TYPE -#undef __API_INT_TYPE_BIT_NUM diff --git a/package/Arm2D/Library/Source/arm_2d.c b/package/Arm2D/Library/Source/arm_2d.c deleted file mode 100644 index c239faceb..000000000 --- a/package/Arm2D/Library/Source/arm_2d.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d.c - * Description: Tables for pixel pipeline OPs - * - * $Date: 11. Aug 2022 - * $Revision: V.1.0.2 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -/*============================ INCLUDES ======================================*/ -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - - -#define __ARM_2D_COMPILATION_UNIT -#include "../Source/__arm_2d_core.c" - -#define __ARM_2D_COMPILATION_UNIT -#include "../Source/__arm_2d_tile.c" - - -#ifdef __cplusplus -extern "C" { -#endif - -/*============================ MACROS ========================================*/ - -#if defined(__ARM_2D_HAS_CDE__) && !__ARM_2D_HAS_CDE__ -# define __arm_2d_cde_init() -#endif - -#if defined(__ARM_2D_HAS_HELIUM__) && !__ARM_2D_HAS_HELIUM__ -# define __arm_2d_helium_init() -#endif - -#if defined(__ARM_2D_HAS_HW_ACC__) && !__ARM_2D_HAS_HW_ACC__ -# define __arm_2d_acc_init() -#endif - -#if defined(__ARM_2D_HAS_ASYNC__) && !__ARM_2D_HAS_ASYNC__ -# define __arm_2d_async_init(...) -#endif - -#ifndef __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ -# define __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ 4 -#endif -#if __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ < 4 -# warning The __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ should be larger than or\ - equal to 4, set it to the default value 4. -# undef __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ -# define __ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__ 4 -#endif - -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -#if defined(__ARM_2D_HAS_ASYNC__) && __ARM_2D_HAS_ASYNC__ -/*! - * \brief initialise the arm-2d pipeline - * \param ptSubTasks an array of __arm_2d_sub_task_t objects - * \param hwCount the number of items in the array - * \return arm_2d_err_t error code - */ -extern -arm_2d_err_t __arm_2d_async_init( __arm_2d_sub_task_t *ptSubTasks, - uint_fast16_t hwCount); -#endif - -#if defined(__ARM_2D_HAS_HELIUM__) && __ARM_2D_HAS_HELIUM__ -/*! - * \brief initialise the helium acceleration - */ -extern -void __arm_2d_helium_init(void); -#endif - -#if defined(__ARM_2D_HAS_CDE__) && __ARM_2D_HAS_CDE__ -/*! - * \brief initialise the cde service - */ -extern -void __arm_2d_cde_init(void); -#endif - - - -#if defined(__ARM_2D_HAS_HW_ACC__) && __ARM_2D_HAS_HW_ACC__ -/*! - * \brief initialise the hardware accelerator adapter - */ -extern -void __arm_2d_acc_init(void); -#endif - - -/*! - * \brief initialise the arm-2d core service - */ -extern -void __arm_2d_init(void); - -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - -/*! - * \brief initialise arm-2d - */ -void arm_2d_init(void) -{ - __arm_2d_init(); - - do { - static __arm_2d_sub_task_t - s_tDefaultTaskPool[__ARM_2D_CFG_DEFAULT_SUB_TASK_POOL_SIZE__]; - - ARM_2D_UNUSED(s_tDefaultTaskPool); - - __arm_2d_async_init(s_tDefaultTaskPool, dimof(s_tDefaultTaskPool)); - } while(0); - - __arm_2d_helium_init(); - __arm_2d_cde_init(); - __arm_2d_acc_init(); -} - -#ifdef __cplusplus -} -#endif diff --git a/package/Arm2D/Library/Source/arm_2d_alpha_blending.c b/package/Arm2D/Library/Source/arm_2d_alpha_blending.c deleted file mode 100644 index a32bd8931..000000000 --- a/package/Arm2D/Library/Source/arm_2d_alpha_blending.c +++ /dev/null @@ -1,2311 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d.c - * Description: APIs for various alpha related operations - * - * $Date: 25. May 2022 - * $Revision: V.1.0.3 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - -/*============================ INCLUDES ======================================*/ -#define __ARM_2D_IMPL__ - - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wmissing-variable-declarations" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 174,177,188,68,513,144 -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - - - - -/*----------------------------------------------------------------------------* - * Accelerable Low Level APIs * - *----------------------------------------------------------------------------*/ - - -/*! adding support with c code template */ - -#define __API_COLOUR gray8 -#define __API_INT_TYPE uint8_t -#define __API_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_GRAY8 - -#include "__arm_2d_alpha_blending.inc" - - -#define __API_COLOUR rgb565 -#define __API_INT_TYPE uint16_t -#define __API_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_RGB565 -#define __PATCH_ALPHA_BLENDING - -#include "__arm_2d_alpha_blending.inc" - - -/*! adding support with c code template */ -#define __API_COLOUR cccn888 -#define __API_INT_TYPE uint32_t -#define __API_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_CCCN888 - -#include "__arm_2d_alpha_blending.inc" - - -#define __API_CAFWM_COLOUR gray8 -#define __API_CAFWM_INT_TYPE uint8_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 8 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_GRAY8 - -#include "__arm_2d_alpha_mask.inc" - -#define __API_CAFWM_CFG_1_HORIZONTAL_LINE 1 -#define __API_CAFWM_COLOUR gray8 -#define __API_CAFWM_INT_TYPE uint8_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 8 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_GRAY8 - -#include "__arm_2d_alpha_mask.inc" - -#define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 1 -#define __API_CAFWM_COLOUR gray8 -#define __API_CAFWM_INT_TYPE uint8_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 8 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_GRAY8 - -#include "__arm_2d_alpha_mask.inc" - - - -#define __API_CAFWM_COLOUR rgb565 -#define __API_CAFWM_INT_TYPE uint16_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 16 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_RGB565 - -#include "__arm_2d_alpha_mask.inc" - -#define __API_CAFWM_CFG_1_HORIZONTAL_LINE 1 -#define __API_CAFWM_COLOUR rgb565 -#define __API_CAFWM_INT_TYPE uint16_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 16 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_RGB565 - -#include "__arm_2d_alpha_mask.inc" - -#define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 1 -#define __API_CAFWM_COLOUR rgb565 -#define __API_CAFWM_INT_TYPE uint16_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 16 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_RGB565 - -#include "__arm_2d_alpha_mask.inc" - - -#define __API_CAFWM_COLOUR cccn888 -#define __API_CAFWM_INT_TYPE uint32_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 32 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_CCCN888 - -#include "__arm_2d_alpha_mask.inc" - -#define __API_CAFWM_CFG_1_HORIZONTAL_LINE 1 -#define __API_CAFWM_COLOUR cccn888 -#define __API_CAFWM_INT_TYPE uint32_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 32 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_CCCN888 - -#include "__arm_2d_alpha_mask.inc" - -#define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 1 -#define __API_CAFWM_COLOUR cccn888 -#define __API_CAFWM_INT_TYPE uint32_t -#define __API_CAFWM_INT_TYPE_BIT_NUM 32 -#define __API_CAFWM_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_CCCN888 - -#include "__arm_2d_alpha_mask.inc" - - -#define __API_ABW_COLOUR gray8 -#define __API_ABW_INT_TYPE uint8_t -#define __API_ABW_INT_TYPE_BIT_NUM 8 -#define __API_ABW_COLOUR_SZ ARM_2D_COLOUR_SZ_8BIT - -#include "__arm_2d_alpha_blending_wrapper.inc" - - -#define __API_ABW_COLOUR rgb565 -#define __API_ABW_INT_TYPE uint16_t -#define __API_ABW_INT_TYPE_BIT_NUM 16 -#define __API_ABW_COLOUR_SZ ARM_2D_COLOUR_SZ_16BIT - -#include "__arm_2d_alpha_blending_wrapper.inc" - - -#define __API_ABW_COLOUR cccn888 -#define __API_ABW_INT_TYPE uint32_t -#define __API_ABW_INT_TYPE_BIT_NUM 32 -#define __API_ABW_COLOUR_SZ ARM_2D_COLOUR_SZ_32BIT - -#include "__arm_2d_alpha_blending_wrapper.inc" - -extern -void __arm_2d_impl_rgb565_alpha_blending_direct( - const uint16_t *phwSource, - const uint16_t *phwBackground, - uint16_t *phwDestination, - uint32_t wPixelCount, - uint_fast16_t hwRatio); - -extern -void __arm_2d_impl_cccn888_alpha_blending_direct( - const uint32_t *__RESTRICT pwSource, - const uint32_t *__RESTRICT pwBackground, - uint32_t *pwDestination, - uint32_t wPixelCount, - uint_fast16_t hwRatio); - - -/*----------------------------------------------------------------------------* - * Copy tile to destination with specified masks * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3,4,5) -arm_fsm_rt_t arm_2dp_gray8_tile_copy_with_masks( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptSrcMask); - assert(NULL != ptTarget); - assert(NULL != ptDesMask); - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, ptSrcMask, - ptTarget, ptDesMask, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_MASK_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = ptSrcMask; - this.Mask.ptTargetSide = ptDesMask; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -ARM_NONNULL(2,3,4,5) -arm_fsm_rt_t arm_2dp_rgb565_tile_copy_with_masks( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptSrcMask); - assert(NULL != ptTarget); - assert(NULL != ptDesMask); - - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, ptSrcMask, - ptTarget, ptDesMask, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_MASK_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = ptSrcMask; - this.Mask.ptTargetSide = ptDesMask; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - - -} - -ARM_NONNULL(2,3,4,5) -arm_fsm_rt_t arm_2dp_cccn888_tile_copy_with_masks( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptSrcMask); - assert(NULL != ptTarget); - assert(NULL != ptDesMask); - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, ptSrcMask, - ptTarget, ptDesMask, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_MASK_CCCN888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = ptSrcMask; - this.Mask.ptTargetSide = ptDesMask; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -/*----------------------------------------------------------------------------* - * Copy tile to destination with a specified source mask * - *----------------------------------------------------------------------------*/ - - -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_gray8_tile_copy_with_src_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptSrcMask); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, ptSrcMask, - ptTarget, NULL, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = ptSrcMask; - this.Mask.ptTargetSide = NULL; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_rgb565_tile_copy_with_src_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptSrcMask); - assert(NULL != ptTarget); - - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, ptSrcMask, - ptTarget, NULL, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = ptSrcMask; - this.Mask.ptTargetSide = NULL; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - - -} - -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_cccn888_tile_copy_with_src_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSrcMask, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptSrcMask); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, ptSrcMask, - ptTarget, NULL, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_CCCN888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = ptSrcMask; - this.Mask.ptTargetSide = NULL; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -/*----------------------------------------------------------------------------* - * Copy tile to destination with a specified target mask * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_gray8_tile_copy_with_des_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - assert(NULL != ptDesMask); - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, NULL, - ptTarget, ptDesMask, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_DES_MASK_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = NULL; - this.Mask.ptTargetSide = ptDesMask; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_rgb565_tile_copy_with_des_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - assert(NULL != ptDesMask); - - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, NULL, - ptTarget, ptDesMask, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_DES_MASK_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = NULL; - this.Mask.ptTargetSide = ptDesMask; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - - -} - -ARM_NONNULL(2,3,4) -arm_fsm_rt_t arm_2dp_cccn888_tile_copy_with_des_mask( - arm_2d_op_cp_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_tile_t *ptDesMask, - const arm_2d_region_t *ptRegion, - uint32_t wMode) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - assert(NULL != ptDesMask); - - ARM_2D_IMPL(arm_2d_op_cp_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate( - ptSource, NULL, - ptTarget, ptDesMask, wMode); - if (tErr < 0) { - return (arm_fsm_rt_t)tErr; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_TILE_COPY_WITH_DES_MASK_CCCN888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = wMode; - this.Mask.ptSourceSide = NULL; - this.Mask.ptTargetSide = ptDesMask; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*----------------------------------------------------------------------------* - * Copy tile to destination with specified transparency ratio (0~255) * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_gray8_alpha_blending( - arm_2d_op_alpha_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_alpha_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_BLENDING_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - this.chRatio = chRatio; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb565_alpha_blending( - arm_2d_op_alpha_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_alpha_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_BLENDING_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - this.chRatio = chRatio; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_cccn888_alpha_blending( arm_2d_op_alpha_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_alpha_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_BLENDING_RGB888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - this.chRatio = chRatio; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_gray8_sw_alpha_blending(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chRatio) { - __arm_2d_impl_c8bit_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - } else { - __arm_2d_impl_gray8_alpha_blending( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize), - this.chRatio); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb565_sw_alpha_blending(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chRatio) { - __arm_2d_impl_rgb16_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - } else { - __arm_2d_impl_rgb565_alpha_blending( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize), - this.chRatio); - } - - return arm_fsm_rt_cpl; -} - - -arm_fsm_rt_t __arm_2d_cccn888_sw_alpha_blending(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (255 == this.chRatio) { - __arm_2d_impl_rgb32_copy( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize); - } else { - __arm_2d_impl_cccn888_alpha_blending( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize), - this.chRatio); - } - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Fill a specified region with a given colour and transparency ratio (0~255) * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_gray8_fill_colour_with_opacity( - arm_2d_op_fill_cl_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - arm_2d_color_gray8_t tColour, - uint_fast8_t chRatio) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_fill_cl_opc_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_COLOUR_FILL_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.chColour = tColour.tValue; - this.chRatio = chRatio; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb565_fill_colour_with_opacity( - arm_2d_op_fill_cl_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - arm_2d_color_rgb565_t tColour, - uint_fast8_t chRatio) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_fill_cl_opc_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_COLOUR_FILL_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.hwColour = tColour.tValue; - this.chRatio = chRatio; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_cccn888_fill_colour_with_opacity( - arm_2d_op_fill_cl_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - arm_2d_color_cccn888_t tColour, - uint_fast8_t chRatio) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_fill_cl_opc_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_COLOUR_FILL_RGB888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.wColour = tColour.tValue; - this.chRatio = chRatio; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -arm_fsm_rt_t __arm_2d_gray8_sw_colour_filling_with_opacity( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_opc_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_GRAY8 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chRatio) { - __arm_2d_impl_c8bit_colour_filling( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.chColour ); - } else { - __arm_2d_impl_gray8_colour_filling_with_opacity( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.chColour, - this.chRatio); - } - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb565_sw_colour_filling_with_opacity( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_opc_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chRatio) { - __arm_2d_impl_rgb16_colour_filling( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.hwColour ); - } else { - __arm_2d_impl_rgb565_colour_filling_with_opacity( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.hwColour, - this.chRatio); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_cccn888_sw_colour_filling_with_opacity( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_opc_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (255 == this.chRatio) { - __arm_2d_impl_rgb32_colour_filling( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.wColour ); - } else { - __arm_2d_impl_cccn888_colour_filling_with_opacity( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.wColour, - this.chRatio); - } - - return arm_fsm_rt_cpl; -} - - -/*----------------------------------------------------------------------------* - * Fill tile with a specified colour and an alpha mask * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_gray8_fill_colour_with_mask( - arm_2d_op_fill_cl_msk_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_gray8_t tColour) -{ - assert(NULL != ptTarget); - assert(NULL != ptAlpha); - - ARM_2D_IMPL(arm_2d_op_fill_cl_msk_t, ptOP); - - //! valid alpha mask tile - if (0 == ptAlpha->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptAlpha->tColourInfo.u3ColourSZ) - && (ARM_2D_CHANNEL_8in32 != ptAlpha->tColourInfo.chScheme)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_WITH_MASK_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Mask.ptTile = ptAlpha; - this.wMode = 0; - this.chColour = tColour.tValue; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - -} - -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_rgb565_fill_colour_with_mask( - arm_2d_op_fill_cl_msk_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_rgb565_t tColour) -{ - assert(NULL != ptTarget); - assert(NULL != ptAlpha); - - ARM_2D_IMPL(arm_2d_op_fill_cl_msk_t, ptOP); - - //! valid alpha mask tile - if (0 == ptAlpha->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptAlpha->tColourInfo.u3ColourSZ) - && (ARM_2D_CHANNEL_8in32 != ptAlpha->tColourInfo.chScheme)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_WITH_MASK_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Mask.ptTile = ptAlpha; - this.wMode = 0; - this.hwColour = tColour.tValue; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - -} - -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_cccn888_fill_colour_with_mask( - arm_2d_op_fill_cl_msk_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_cccn888_t tColour) -{ - assert(NULL != ptTarget); - assert(NULL != ptAlpha); - - ARM_2D_IMPL(arm_2d_op_fill_cl_msk_t, ptOP); - - //! valid alpha mask tile - if (0 == ptAlpha->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptAlpha->tColourInfo.u3ColourSZ) - && (ARM_2D_CHANNEL_8in32 != ptAlpha->tColourInfo.chScheme)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_WITH_MASK_CCCN888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Mask.ptTile = ptAlpha; - this.wMode = 0; - this.wColour = tColour.tValue; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - -} - - -arm_fsm_rt_t __arm_2d_gray8_sw_colour_filling_with_mask( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_msk_t, ptTask->ptOP) - //assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopy.tSource.tColour.chScheme) { - - #if !__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #else - __arm_2d_impl_gray8_colour_filling_channel_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.chColour); - #endif - - } else { - __arm_2d_impl_gray8_colour_filling_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.chColour); - } - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb565_sw_colour_filling_with_mask( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_msk_t, ptTask->ptOP) - //assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopy.tSource.tColour.chScheme) { - #if !__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #else - __arm_2d_impl_rgb565_colour_filling_channel_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.hwColour); - #endif - } else { - __arm_2d_impl_rgb565_colour_filling_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.hwColour); - } - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_cccn888_sw_colour_filling_with_mask( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_msk_t, ptTask->ptOP) - //assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopy.tSource.tColour.chScheme) { - #if !__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #else - __arm_2d_impl_cccn888_colour_filling_channel_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.wColour); - #endif - } else { - __arm_2d_impl_cccn888_colour_filling_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.wColour); - } - - return arm_fsm_rt_cpl; -} - - - -/*----------------------------------------------------------------------------* - * Fill tile with a specified colour, an alpha mask and a specified opacity * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_gray8_fill_colour_with_mask_and_opacity( - arm_2d_op_alpha_fill_cl_msk_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_gray8_t tColour, - uint8_t chOpacity) -{ - assert(NULL != ptTarget); - assert(NULL != ptAlpha); - - - ARM_2D_IMPL(arm_2d_op_alpha_fill_cl_msk_opc_t, ptOP); - - //! valid alpha mask tile - if (0 == ptAlpha->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptAlpha->tColourInfo.u3ColourSZ) - && (ARM_2D_CHANNEL_8in32 != ptAlpha->tColourInfo.chScheme)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Mask.ptTile = ptAlpha; - this.wMode = 0; - this.chColour = tColour.tValue; - this.chRatio = chOpacity; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - -} - -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_rgb565_fill_colour_with_mask_and_opacity( - arm_2d_op_alpha_fill_cl_msk_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_rgb565_t tColour, - uint8_t chOpacity) -{ - assert(NULL != ptTarget); - assert(NULL != ptAlpha); - - - ARM_2D_IMPL(arm_2d_op_alpha_fill_cl_msk_opc_t, ptOP); - - //! valid alpha mask tile - if (0 == ptAlpha->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptAlpha->tColourInfo.u3ColourSZ) - && (ARM_2D_CHANNEL_8in32 != ptAlpha->tColourInfo.chScheme)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Mask.ptTile = ptAlpha; - this.wMode = 0; - this.hwColour = tColour.tValue; - this.chRatio = chOpacity; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - -} - -ARM_NONNULL(2,4) -arm_fsm_rt_t arm_2dp_cccn888_fill_colour_with_mask_and_opacity( - arm_2d_op_alpha_fill_cl_msk_opc_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_tile_t *ptAlpha, - arm_2d_color_cccn888_t tColour, - uint8_t chOpacity) -{ - assert(NULL != ptTarget); - assert(NULL != ptAlpha); - - ARM_2D_IMPL(arm_2d_op_alpha_fill_cl_msk_opc_t, ptOP); - - //! valid alpha mask tile - if (0 == ptAlpha->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } else if ( (ARM_2D_COLOUR_SZ_8BIT != ptAlpha->tColourInfo.u3ColourSZ) - && (ARM_2D_CHANNEL_8in32 != ptAlpha->tColourInfo.chScheme)) { - return (arm_fsm_rt_t)ARM_2D_ERR_INVALID_PARAM; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_CCCN888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Mask.ptTile = ptAlpha; - this.wMode = 0; - this.wColour = tColour.tValue; - this.chRatio = chOpacity; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); - -} - - -arm_fsm_rt_t __arm_2d_gray8_sw_colour_filling_with_mask_and_opacity( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_fill_cl_msk_opc_t, ptTask->ptOP) - //assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopy.tSource.tColour.chScheme) { - #if !__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #else - - if (255 == this.chRatio) { - __arm_2d_impl_gray8_colour_filling_channel_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.chColour); - } else { - __arm_2d_impl_gray8_colour_filling_channel_mask_opacity( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.chColour, - this.chRatio); - } - #endif - } else { - if (255 == this.chRatio) { - __arm_2d_impl_gray8_colour_filling_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.chColour); - } else { - __arm_2d_impl_gray8_colour_filling_mask_opacity( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.chColour, - this.chRatio); - } - } - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb565_sw_colour_filling_with_mask_and_opacity( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_fill_cl_msk_opc_t, ptTask->ptOP) - //assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopy.tSource.tColour.chScheme) { - #if !__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #else - if (255 == this.chRatio) { - __arm_2d_impl_rgb565_colour_filling_channel_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.hwColour); - } else { - __arm_2d_impl_rgb565_colour_filling_channel_mask_opacity( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.hwColour, - this.chRatio); - } - #endif - } else { - if (255 == this.chRatio) { - __arm_2d_impl_rgb565_colour_filling_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.hwColour); - } else { - __arm_2d_impl_rgb565_colour_filling_mask_opacity( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.hwColour, - this.chRatio); - } - } - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_cccn888_sw_colour_filling_with_mask_and_opacity( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_fill_cl_msk_opc_t, ptTask->ptOP) - //assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (ARM_2D_CHANNEL_8in32 == ptTask->Param.tCopy.tSource.tColour.chScheme) { - #if !__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - #else - if (255 == this.chRatio) { - __arm_2d_impl_cccn888_colour_filling_channel_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.wColour); - } else { - __arm_2d_impl_cccn888_colour_filling_channel_mask_opacity( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.wColour, - this.chRatio); - } - #endif - } else { - if (255 == this.chRatio) { - __arm_2d_impl_cccn888_colour_filling_mask( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.wColour); - } else { - __arm_2d_impl_cccn888_colour_filling_mask_opacity( - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - ptTask->Param.tCopy.tSource.pBuffer, //!< alpha tile - ptTask->Param.tCopy.tSource.iStride, //!< alpha tile - &(ptTask->Param.tCopy.tCopySize), - this.wColour, - this.chRatio); - } - } - - return arm_fsm_rt_cpl; -} - - - - -/*----------------------------------------------------------------------------* - * Blend tile and background with a specified transparency ratio(0~255) and a * - * specified transparency color mask * - *----------------------------------------------------------------------------*/ - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_gray8_alpha_blending_with_colour_keying( - arm_2d_op_alpha_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio, - arm_2d_color_gray8_t tColour) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_alpha_cl_key_t); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - this.chRatio = chRatio; - this.chColour = tColour.tValue; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb565_alpha_blending_with_colour_keying( - arm_2d_op_alpha_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio, - arm_2d_color_rgb565_t tColour) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_alpha_cl_key_t); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - this.chRatio = chRatio; - this.hwColour = tColour.tValue; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_cccn888_alpha_blending_with_colour_keying( - arm_2d_op_alpha_cl_key_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chRatio, - arm_2d_color_cccn888_t tColour) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_alpha_cl_key_t); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = & ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptSource; - this.wMode = 0; - this.chRatio = chRatio; - this.wColour = tColour.tValue; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_gray8_sw_alpha_blending_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_cl_key_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_GRAY8 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chRatio) { - __arm_2d_impl_c8bit_cl_key_copy( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.chColour); - } else { - __arm_2d_impl_gray8_alpha_blending_colour_keying( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.chRatio, - this.chColour); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb565_sw_alpha_blending_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_cl_key_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chRatio) { - __arm_2d_impl_rgb16_cl_key_copy( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.hwColour); - } else { - __arm_2d_impl_rgb565_alpha_blending_colour_keying( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.chRatio, - this.hwColour); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_cccn888_sw_alpha_blending_with_colour_keying( - __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_alpha_cl_key_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (255 == this.chRatio) { - __arm_2d_impl_rgb32_cl_key_copy( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.wColour); - } else { - __arm_2d_impl_cccn888_alpha_blending_colour_keying( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - this.chRatio, - this.wColour); - } - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Accelerable Low Level APIs * - *----------------------------------------------------------------------------*/ - - -__WEAK -void __arm_2d_impl_rgb565_alpha_blending( uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint_fast16_t hwRatio) -{ - uint32_t iHeight = ptCopySize->iHeight; - uint32_t iWidth = ptCopySize->iWidth; - - uint16_t ratioCompl = 256 - hwRatio; - - ARM_2D_UNUSED(ratioCompl); - - for (uint32_t y = 0; y < iHeight; y++) { - -#if (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) - /* M55 NOMVE optimization */ - register unsigned loopCnt __asm("lr"); - loopCnt = iWidth; - - __asm volatile( - " dls lr, lr \n" - ".p2align 2 \n" - "1: \n" - /* read source / target pixel */ - " ldrh r4, [%[src]], #2 \n" - " ldrh r5, [%[pTarget]] \n" - - /* unpack R */ - " and r0, r4, #31 \n" - " and r1, r5, #31 \n" - - /* unpack B */ - " lsr r2, r4, #11 \n" - " lsr r3, r5, #11 \n" - - /* unpack G */ - " ubfx r4, r4, #5, #6 \n" - " ubfx r5, r5, #5, #6 \n" - - /* mix */ - " mul r0, r0, %[ratio0] \n" - " mul r4, r4, %[ratio0] \n" - " mul r2, r2, %[ratio0] \n" - - " mla r0, %[ratio1], r1, r0 \n" - " mla r1, %[ratio1], r5, r4 \n" - - /* pack R */ - " ubfx r0, r0, #8, #5 \n" - /* shift & mask G */ - " and r1, %[cst], r1, lsr #3 \n" - /* MLA moved here to fill stall */ - " mla r5, %[ratio1], r3, r2 \n" - - /* pack G */ - " add r0, r0, r1 \n" - /* pack R */ - " bic r1, r5, #255 \n" - " orr r0, r0, r1, lsl #3 \n" - - " strh r0, [%[pTarget]], #2 \n" - " le lr, 1b \n" - - : [src] "+r" (phwSourceBase), [pTarget] "+r" (phwTargetBase), - [cnt] "+r" (loopCnt) - : [ratio1] "r" ((256 - (uint_fast16_t)hwRatio) ), - [ratio0] "r" (hwRatio), [cst] "r" (0x7e0 /* mask G */) - : "r0", "r1", "r2", "r3", - "r4", "r5", "memory" - ); -#else - - for (uint32_t x = 0; x < iWidth; x++) { - __arm_2d_color_fast_rgb_t srcPix, targetPix; - - __arm_2d_rgb565_unpack(*phwSourceBase++, &srcPix); - __arm_2d_rgb565_unpack(*phwTargetBase, &targetPix); - - for (int i = 0; i < 3; i++) { - uint16_t tmp = - (uint16_t) (srcPix.BGRA[i] * hwRatio) + - (targetPix.BGRA[i] * ratioCompl); - targetPix.BGRA[i] = (uint16_t) (tmp >> 8); - } - /* pack merged stream */ - *phwTargetBase++ = __arm_2d_rgb565_pack(&targetPix); - } -#endif - phwSourceBase += (iSourceStride - iWidth); - phwTargetBase += (iTargetStride - iWidth); - } -} - -/*----------------------------------------------------------------------------* - * Low Level IO Interfaces * - *----------------------------------------------------------------------------*/ - - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_GRAY8, - __arm_2d_gray8_sw_colour_filling_with_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_RGB565, - __arm_2d_rgb565_sw_colour_filling_with_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_RGB888, - __arm_2d_cccn888_sw_colour_filling_with_mask); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_AND_OPACITY_GRAY8, - __arm_2d_gray8_sw_colour_filling_with_mask_and_opacity); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_AND_OPACITY_RGB565, - __arm_2d_rgb565_sw_colour_filling_with_mask_and_opacity); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_AND_OPACITY_CCCN888, - __arm_2d_cccn888_sw_colour_filling_with_mask_and_opacity); - -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_GRAY8, - __arm_2d_gray8_sw_alpha_blending); -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_RGB565, - __arm_2d_rgb565_sw_alpha_blending); -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_RGB888, - __arm_2d_cccn888_sw_alpha_blending); - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_MASKS_GRAY8, - __arm_2d_gray8_sw_tile_copy_with_masks); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_MASKS_GRAY8, - __arm_2d_gray8_sw_tile_fill_with_masks); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_MASKS_RGB565, - __arm_2d_rgb565_sw_tile_copy_with_masks); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_MASKS_RGB565, - __arm_2d_rgb565_sw_tile_fill_with_masks); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_MASKS_CCCN888, - __arm_2d_cccn888_sw_tile_copy_with_masks); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_MASKS_CCCN888, - __arm_2d_cccn888_sw_tile_fill_with_masks); - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_SRC_MASK_GRAY8, - __arm_2d_gray8_sw_tile_copy_with_src_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_SRC_MASK_GRAY8, - __arm_2d_gray8_sw_tile_fill_with_src_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_SRC_MASK_RGB565, - __arm_2d_rgb565_sw_tile_copy_with_src_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_SRC_MASK_RGB565, - __arm_2d_rgb565_sw_tile_fill_with_src_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_SRC_MASK_CCCN888, - __arm_2d_cccn888_sw_tile_copy_with_src_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_SRC_MASK_CCCN888, - __arm_2d_cccn888_sw_tile_fill_with_src_mask); - - -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_DES_MASK_GRAY8, - __arm_2d_gray8_sw_tile_copy_with_des_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_DES_MASK_GRAY8, - __arm_2d_gray8_sw_tile_fill_with_des_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_DES_MASK_RGB565, - __arm_2d_rgb565_sw_tile_copy_with_des_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_DES_MASK_RGB565, - __arm_2d_rgb565_sw_tile_fill_with_des_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_COPY_WITH_DES_MASK_CCCN888, - __arm_2d_cccn888_sw_tile_copy_with_des_mask); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_WITH_DES_MASK_CCCN888, - __arm_2d_cccn888_sw_tile_fill_with_des_mask); - - -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_WITH_COLOUR_KEYING_GRAY8, - __arm_2d_gray8_sw_alpha_blending_with_colour_keying); -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB565, - __arm_2d_rgb565_sw_alpha_blending_with_colour_keying); -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB888, - __arm_2d_cccn888_sw_alpha_blending_with_colour_keying); - -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_FILL_COLOUR_GRAY8, - __arm_2d_gray8_sw_colour_filling_with_opacity); -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_FILL_COLOUR_RGB565, - __arm_2d_rgb565_sw_colour_filling_with_opacity); -__WEAK -def_low_lv_io(__ARM_2D_IO_ALPHA_FILL_COLOUR_RGB888, - __arm_2d_cccn888_sw_colour_filling_with_opacity); - - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_GRAY8), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_RGB565), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_RGB888), - .ptFillLike = NULL, - }, - }, -}; - - - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK_AND_OPACITY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_AND_OPACITY_GRAY8), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK_AND_OPACITY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_AND_OPACITY_RGB565), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_WITH_MASK_AND_OPACITY_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR_WITH_MASK_AND_OPACITY, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_ALPHA_MASK_AND_OPACITY_CCCN888), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_BLENDING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_GRAY8), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_BLENDING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_RGB565), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_RGB888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_BLENDING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_RGB888), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_BLENDING_WITH_COLOUR_KEYING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_WITH_COLOUR_KEYING_GRAY8), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_BLENDING_WITH_COLOUR_KEYING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB565), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_BLENDING_WITH_COLOUR_KEYING, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_BLENDING_WITH_COLOUR_KEYING_RGB888), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_COLOUR_FILL_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_FILL_COLOUR, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_FILL_COLOUR_GRAY8), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_COLOUR_FILL_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_FILL_COLOUR, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_FILL_COLOUR_RGB565), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_ALPHA_COLOUR_FILL_RGB888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_ALPHA_FILL_COLOUR, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_ALPHA_FILL_COLOUR_RGB888), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_MASK_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = true, - .bHasDesMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_MASKS, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_MASKS_GRAY8), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_MASKS_GRAY8), - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_MASK_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = true, - .bHasDesMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_MASKS, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_MASKS_RGB565), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_MASKS_RGB565), - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_MASK_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = true, - .bHasDesMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_MASKS, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_MASKS_CCCN888), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_MASKS_CCCN888), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = true, - .bHasDesMask = false, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_SOURCE_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_SRC_MASK_GRAY8), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_SRC_MASK_GRAY8), - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = true, - .bHasDesMask = false, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_SOURCE_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_SRC_MASK_RGB565), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_SRC_MASK_RGB565), - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_SRC_MASK_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = true, - .bHasDesMask = false, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_SOURCE_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_SRC_MASK_CCCN888), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_SRC_MASK_CCCN888), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_DES_MASK_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = false, - .bHasDesMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_TARGET_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_DES_MASK_GRAY8), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_DES_MASK_GRAY8), - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_DES_MASK_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = false, - .bHasDesMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_TARGET_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_DES_MASK_RGB565), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_DES_MASK_RGB565), - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TILE_COPY_WITH_DES_MASK_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bHasSrcMask = false, - .bHasDesMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COPY_WITH_TARGET_MASK, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COPY_WITH_DES_MASK_CCCN888), - .ptFillLike = ref_low_lv_io(__ARM_2D_IO_FILL_WITH_DES_MASK_CCCN888), - }, - }, -}; - - -#ifdef __cplusplus -} -#endif diff --git a/package/Arm2D/Library/Source/arm_2d_async.c b/package/Arm2D/Library/Source/arm_2d_async.c deleted file mode 100644 index 1b1ab65e4..000000000 --- a/package/Arm2D/Library/Source/arm_2d_async.c +++ /dev/null @@ -1,1019 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_async.c - * Description: Pixel pipeline extensions for support hardware acceleration. - * - * $Date: 31. May 2022 - * $Revision: V.1.0.2 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -/*============================ INCLUDES ======================================*/ -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__ARM_2D_HAS_ASYNC__) && __ARM_2D_HAS_ASYNC__ - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wswitch-enum" -# pragma clang diagnostic ignored "-Wswitch" -# pragma clang diagnostic ignored "-Wimplicit-fallthrough" -# pragma clang diagnostic ignored "-Wgnu-statement-expression" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 174,177,188,68,513,144 -#elif defined(__IS_COMPILER_IAR__) -# pragma diag_suppress=Pa089,Pe188 -#elif defined(__IS_COMPILER_GCC__) -# pragma GCC diagnostic ignored "-Wswitch" -# pragma GCC diagnostic ignored "-Wenum-compare" -# pragma GCC diagnostic ignored "-Wpedantic" -# pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - -/*----------------------------------------------------------------------------* - * Subtask Pool * - *----------------------------------------------------------------------------*/ - -static void __arm_2d_sub_task_booking(uint_fast16_t hwCount) -{ - arm_irq_safe { - ARM_2D_CTRL.hwBookCount += hwCount; - } -} - -static void __arm_2d_sub_task_cancel_booking(void) -{ - arm_irq_safe { - ARM_2D_CTRL.hwBookCount = 0; - } -} - -static uint_fast16_t __arm_2d_sub_task_available_count(void) -{ - uint_fast16_t hwResult = 0; - - arm_irq_safe { - hwResult = ARM_2D_CTRL.hwFreeCount; - hwResult = (hwResult > ARM_2D_CTRL.hwBookCount) - ? hwResult - ARM_2D_CTRL.hwBookCount - : 0; - } - - return hwResult; -} - -static -__arm_2d_sub_task_t *__arm_2d_sub_task_new(void) -{ - __arm_2d_sub_task_t *ptTask = NULL; - - arm_irq_safe { - if (NULL != ARM_2D_CTRL.ptFreeList) { - ARM_LIST_STACK_POP(ARM_2D_CTRL.ptFreeList, ptTask); - if (ARM_2D_CTRL.hwBookCount) { - ARM_2D_CTRL.hwBookCount--; - } - - ARM_2D_CTRL.hwFreeCount--; - } - } - - memset(ptTask, 0 ,sizeof(__arm_2d_sub_task_t)); - - return ptTask; -} - -static -void __arm_2d_sub_task_free(__arm_2d_sub_task_t *ptTask) -{ - if (NULL == ptTask) { - return ; - } - - arm_irq_safe { - ARM_LIST_STACK_PUSH(ARM_2D_CTRL.ptFreeList, ptTask); - ARM_2D_CTRL.hwFreeCount++; - } -} - -/*----------------------------------------------------------------------------* - * Subtask FIFO * - *----------------------------------------------------------------------------*/ -#if 0 -__WEAK -void arm_2d_notif_sub_task_fifo_task_arrive(void) -{ -} -#endif - -static -void __arm_2d_sub_task_add(__arm_2d_sub_task_t *ptTask) -{ - assert(NULL != ptTask); - //bool bIsEmpty = false; - arm_irq_safe { - //bIsEmpty = (0 == ARM_2D_CTRL.hwTaskCount); - - ARM_LIST_QUEUE_ENQUEUE( ARM_2D_CTRL.TaskFIFO.ptHead, - ARM_2D_CTRL.TaskFIFO.ptTail, - ptTask); - ARM_2D_CTRL.hwTaskCount++; - } -#if 0 - if (bIsEmpty) { - arm_2d_notif_sub_task_fifo_task_arrive(); - } -#endif -} - -static -__arm_2d_sub_task_t * __arm_2d_sub_task_fetch(void) -{ - __arm_2d_sub_task_t *ptTask = NULL; - - arm_irq_safe { - if (NULL != ARM_2D_CTRL.TaskFIFO.ptHead) { - ARM_LIST_QUEUE_DEQUEUE( ARM_2D_CTRL.TaskFIFO.ptHead, - ARM_2D_CTRL.TaskFIFO.ptTail, - ptTask); - ARM_2D_CTRL.hwTaskCount--; - } - } - - return ptTask; -} - - -/*----------------------------------------------------------------------------* - * Subtask Processing * - *----------------------------------------------------------------------------*/ - -static -arm_fsm_rt_t __arm_2d_call_default_io( __arm_2d_sub_task_t *ptTask, - uint_fast8_t chInterfaceIndex) -{ - assert(NULL != ptTask); - - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - ARM_2D_IMPL(arm_2d_op_t, ptTask->ptOP); - uint_fast8_t chAccPreference = OP_CORE.Preference.u2ACCMethods; - - do { - if (chAccPreference != ARM_2D_PREF_ACC_SW_ONLY) { - /* call hardware accelerator */ - /*! \note the HW accelerator service routine will check the paratmer - *! and decide whether the requested service is supported or - *! not: - *! - if it is not supported, ARM_2D_ERR_NOT_SUPPORT will be - *! returned. - *! - *! - if it is supported and the service is to be done later, - *! the sub-task will be queued and arm_fsm_rt_async is - *! returned. Once the sub-task is complete, - *! __arm_2d_notify_sub_task_cpl() should be called by HW - *! accelerator service routine/tasks. - *! - *! - if it is supported and the service is complete immediately - *! the arm_fsm_rt_cpl is returned. - *! - *! - if there are any error detected, negative error code will be - *! returned. - */ - - ARM_2D_TRY_ACCELERATION( chInterfaceIndex, __arm_2d_io_func_t ); - - assert(tResult != arm_fsm_rt_on_going); - - switch (tResult) { - case arm_fsm_rt_wait_for_obj: - /*! \note the HW accelerator wants to sync-up with user - *! application - */ - if (chAccPreference == ARM_2D_PREF_ACC_DONT_CARE) { - /* since people choose don't care, then use SW */ - break; - } - return tResult; - - case arm_fsm_rt_on_going: - /*! \note HW accelerator should NOT return on_going otherwise - *! it will be treated as ARM_2D_ERR_IO_BUSY - */ - if (chAccPreference == ARM_2D_PREF_ACC_DONT_CARE) { - /* since people choose don't care, then use SW */ - break; - } - return (arm_fsm_rt_t)ARM_2D_ERR_IO_BUSY; - - case ARM_2D_ERR_NOT_SUPPORT: - break; - - case arm_fsm_rt_async: - case arm_fsm_rt_cpl: - default: - /* other errors */ - return tResult; - } - - if ( (chAccPreference == ARM_2D_PREF_ACC_HW_ONLY) - && (ARM_2D_ERR_NOT_SUPPORT == tResult)) { - //! the hardware acceleration isn't avaialble - break; - } - } - - /* call default software implementation */ - /*! \note the default software implemenation will only return following - *! values: - *! - arm_fsm_rt_cpl the service is complete. - *! - arm_fsm_rt_on_going the software algorithm wants to yield - *! - arm_fsm_rt_wait_for_obj the software algorithm wants to sync - *! with user application - *! - arm_fsm_rt_async the software algorithm is implemented - *! in asynchronous mode - *! - negative error code - */ - - ARM_2D_RUN_DEFAULT( chInterfaceIndex, __arm_2d_io_func_t ); - } while(0); - return tResult; -} - - -__WEAK -void arm_2d_notif_aync_op_cpl(uintptr_t pUserParam) -{ -} - - -static void __arm_2d_notify_op_cpl(arm_2d_op_core_t *ptOP, arm_fsm_rt_t tResult) -{ - assert(tResult != arm_fsm_rt_async); - assert(tResult != arm_fsm_rt_on_going); - assert(tResult != arm_fsm_rt_wait_for_obj); - - //! error detected - if (tResult < 0) { - //! update error info - ptOP->tResult = tResult; - ptOP->Status.bIOError = true; - } - - //! handle target OP - - - if (0 == ptOP->Status.u4SubTaskCount) { - //! this is the last sub task - - //! no error has ever happened - if (ptOP->tResult >= 0) { - ptOP->tResult = tResult; - } - - //! call Operation Complete event handler - if (NULL != ptOP->evt2DOpCpl.fnHandler) { - (ptOP->evt2DOpCpl.fnHandler) ( ptOP, - ptOP->tResult, - ptOP->evt2DOpCpl.pTarget); - ptOP->evt2DOpCpl.fnHandler = NULL; - } - - /*! \note complete doesn't mean no err */ - ptOP->Status.bOpCpl = true; - - //! reset preference - ptOP->Preference.u2ACCMethods = 0; - - /*! arm_thread_safe */ - arm_irq_safe { - //! only clear busy flag after bOpCpl is set properly. - ptOP->Status.bIsBusy = false; - - arm_2d_notif_aync_op_cpl(ptOP->pUserParam); - } - } -} - -__WEAK -void arm_2d_notif_aync_sub_task_cpl(uintptr_t pUserParam) -{ -} - -/*! \note This API should be called by both arm_2d_task and hardware - *! accelerator to indicate the completion of a sub task - */ -void __arm_2d_notify_sub_task_cpl( __arm_2d_sub_task_t *ptTask, - arm_fsm_rt_t tResult, - bool bFromHW) -{ - ARM_2D_UNUSED(bFromHW); - - arm_2d_op_core_t *ptOP = ptTask->ptOP; - - assert(NULL != ptTask); - assert(NULL != ptOP); - assert(ptOP->Status.u4SubTaskCount > 0); - - /* free sub task */ - __arm_2d_sub_task_free(ptTask); - - /* depose resources hold by the sub task */ - __arm_2d_sub_task_depose(ptOP); - - //if (bFromHW) { - arm_2d_notif_aync_sub_task_cpl(ptOP->pUserParam); - //} - - ptOP->Status.u4SubTaskCount--; - __arm_2d_notify_op_cpl(ptOP, tResult); - -} - -/*! \note You can override this to add support for new types of interface - *! \param ptTask pointer of target sub task - *! \return the result - */ -arm_fsm_rt_t __arm_2d_sub_task_dispatch(__arm_2d_sub_task_t *ptTask) -{ - - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_INVALID_OP; - //ARM_2D_IMPL(arm_2d_op_t, ptTask->ptOP); - - //if (ptTask->chLowLeveIOIndex < dimof(__ARM_2D_IO_TABLE.OP)) { - tResult = __arm_2d_call_default_io( ptTask, ptTask->chLowLeveIOIndex); - //} - - return tResult; - -} - - - - -#define __ARM_2D_BACKEND_TASK_RESET_FSM() do {this.chState = START;} while(0); - - /*! \brief arm-2d pixel pipeline backend task entery - *! \note This function is *TRHEAD-SAFE* - *! \param none - *! \retval arm_fsm_rt_cpl The sub-task FIFO is empty, the caller, i.e. the host - *! RTOS thread can block itself by waiting for a semaphore which is - *! set by arm_2d_notif_sub_task_fifo_task_arrive() - *! \retval arm_fsm_rt_on_going The arm_2d_task issued one sub-task without - *! problem and it yields. - *! \retval arm_fsm_rt_async You shouldn't see this value - *! \retval arm_fsm_rt_wait_for_obj some algorithm or hardware accelerator wants - *! to sync-up with applications. - *! \retval (<0) Serious error is detected. - */ -static -arm_fsm_rt_t __arm_2d_backend_task(arm_2d_task_t *ptThis) -{ - - enum { - START = 0, - FETCH, - DISPATCH, - }; - - switch(this.chState) { - case START: - this.tResult = (arm_fsm_rt_t)ARM_2D_ERR_INVALID_OP; - this.chState++; - //break; - - case FETCH: - - //! fetch a sub task from FIFO - this.ptTask = __arm_2d_sub_task_fetch(); - if (NULL == this.ptTask) { - __ARM_2D_BACKEND_TASK_RESET_FSM(); - return arm_fsm_rt_cpl; - } - this.chState++; - //break; - - case DISPATCH: - - //! dispatch sub tasks - this.tResult = - __arm_2d_sub_task_dispatch((__arm_2d_sub_task_t *)this.ptTask); - - if ( (arm_fsm_rt_on_going == this.tResult) //!< sub task wants to yield - || (arm_fsm_rt_wait_for_obj == this.tResult)) { //!< sub task wants to sync-up with applications - return this.tResult; - } - - if (this.tResult != arm_fsm_rt_async) { - //! get result immediately - __arm_2d_notify_sub_task_cpl( - (__arm_2d_sub_task_t *)this.ptTask, - this.tResult, - false); - } - /*! \note (arm_fsm_rt_async == tResult) means the sub task hasn't - *! been handled yet - */ - - __ARM_2D_BACKEND_TASK_RESET_FSM(); - - //! unsupported operation - if (ARM_2D_ERR_INVALID_OP == this.tResult){ - return this.tResult; - } - - break; - } - - - return arm_fsm_rt_on_going; -} - - /*! \brief arm-2d pixel pipeline backend task entery - *! \note This function is *TRHEAD-SAFE* - *! \param none - *! \retval arm_fsm_rt_cpl The OPCODE FIFO is empty, the caller, i.e. the host - *! RTOS thread can block itself by waiting for a semaphore which is - *! set by arm_2d_notif_sub_task_fifo_task_arrive() - *! \retval arm_fsm_rt_on_going The frontend issued one OPCODE without - *! problem and it yields. - *! \retval arm_fsm_rt_async You shouldn't see this value - *! \retval arm_fsm_rt_wait_for_obj some algorithm or hardware accelerator wants - *! to sync-up with applications. - *! \retval (<0) Serious error is detected. - */ -static -arm_fsm_rt_t __arm_2d_frontend_task(arm_2d_task_t *ptThis) -{ - arm_2d_op_core_t *ptOP = NULL; - arm_fsm_rt_t tResult; - - arm_irq_safe { - ARM_LIST_QUEUE_PEEK(ARM_2D_CTRL.OPFIFO.ptHead, - ARM_2D_CTRL.OPFIFO.ptTail, - ptOP); - } - - if (NULL == ptOP) { - return arm_fsm_rt_cpl; - } - - tResult = __arm_2d_op_frontend_op_decoder(ptOP); - - if ((arm_fsm_rt_cpl == tResult) || (tResult < 0)) { - - arm_irq_safe { - ARM_LIST_QUEUE_DEQUEUE( ARM_2D_CTRL.OPFIFO.ptHead, - ARM_2D_CTRL.OPFIFO.ptTail, - ptOP); - } - ptOP->Status.u4SubTaskCount = 0; - __arm_2d_notify_op_cpl(ptOP, tResult); - } else if (arm_fsm_rt_async == tResult) { - arm_irq_safe { - ARM_LIST_QUEUE_DEQUEUE( ARM_2D_CTRL.OPFIFO.ptHead, - ARM_2D_CTRL.OPFIFO.ptTail, - ptOP); - } - } - - /* release resources here */ - __arm_2d_sub_task_cancel_booking(); - - if ( arm_fsm_rt_wait_for_obj == tResult - || arm_fsm_rt_wait_for_res == tResult) { - return tResult; - } - - assert(arm_fsm_rt_on_going != tResult); - - return arm_fsm_rt_on_going; -} - -/*! - * \brief arm-2d pixel pipeline task entery - * \note This function is *TRHEAD-SAFE* - * \param ptTask the address of an arm-2d task control block - * \retval arm_fsm_rt_cpl The sub-task FIFO is empty, the caller can wait for a - * semaphore set by arm_2d_notif_sub_task_fifo_task_arrive() - * \retval arm_fsm_rt_on_going The arm_2d_task yields - * \retval arm_fsm_rt_async You shouldn't see this value - * \retval arm_fsm_rt_wait_for_obj hardware accelerator wants to sync-up with applications. - * \retval (<0) Serious error is detected. - */ -arm_fsm_rt_t arm_2d_task(arm_2d_task_t *ptThis) -{ - arm_fsm_rt_t tResult; - - do { - tResult = __arm_2d_backend_task(ptThis); - - if (arm_fsm_rt_cpl != tResult) { - break; - } - - tResult = __arm_2d_frontend_task(ptThis); - if (arm_fsm_rt_on_going == tResult){ - continue; - } - - break; - - } while(true); - - return tResult; -} - - -/*----------------------------------------------------------------------------* - * Overridden Implementations * - *----------------------------------------------------------------------------*/ - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_op_frontend_on_leave( arm_2d_op_core_t *ptThis, - arm_fsm_rt_t tResult) -{ - - - if (!ARM_2D_RUNTIME_FEATURE.HAS_DEDICATED_THREAD_FOR_2D_TASK) { - arm_fsm_rt_t tTaskResult; - arm_2d_task_t tTaskCB = {0}; - do { - tTaskResult = arm_2d_task(&tTaskCB); - } while(arm_fsm_rt_on_going == tTaskResult); - - if (tTaskResult < 0) { - //! a serious error is detected - tResult = tTaskResult; - } else if (arm_fsm_rt_wait_for_obj == tTaskResult) { - tResult = tTaskResult; - } else { - tResult = this.tResult; - } - } - - return tResult; -} - -__WEAK -void arm_2d_notif_new_op_arrive(uintptr_t pUserParam) -{ -} - - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_op_frontend(arm_2d_op_core_t *ptThis) -{ - bool bEmptyQueue = false; - arm_fsm_rt_t tResult; - arm_irq_safe { - if (NULL == ARM_2D_CTRL.OPFIFO.ptHead) { - bEmptyQueue = true; - } - - ARM_LIST_QUEUE_ENQUEUE( ARM_2D_CTRL.OPFIFO.ptHead, - ARM_2D_CTRL.OPFIFO.ptTail, - ptThis); - } - - tResult = __arm_2d_op_frontend_on_leave(ptThis, this.tResult); - - if (bEmptyQueue) { - arm_2d_notif_new_op_arrive(this.pUserParam); - } - - return tResult; -} - -__OVERRIDE_WEAK -bool __arm_2d_op_ensure_resource( arm_2d_op_core_t *ptOP, - uint_fast16_t hwRequired) -{ - bool bResult = false; - - ARM_2D_UNUSED(ptOP); - - arm_irq_safe { - bResult = (__arm_2d_sub_task_available_count() >= hwRequired); - if (bResult) { - __arm_2d_sub_task_booking(hwRequired); - } - } - - return bResult; -} - - - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_tile_process( - arm_2d_op_t *ptThis, - __arm_2d_tile_param_t *ptParam) -{ - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 0, - .Param.tTileProcess = *ptParam, - }; - - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_fill( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptTarget) -{ - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 1, - .Param.tFill = { - .tSource = *ptSource, - .tTarget = *ptTarget, - }, - }; - - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_fill_with_mask( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptSourceMask, - __arm_2d_tile_param_t *ptTarget, - __arm_2d_tile_param_t *ptTargetMask) -{ - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 1, - .Param.tFillMask = { - .use_as____arm_2d_param_fill_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - }, - }, - }; - - if (NULL == ptSourceMask){ - ptTask->Param.tFillMask.tSrcMask.bInvalid = true; - } else { - ptTask->Param.tFillMask.tSrcMask = *ptSourceMask; - } - - if (NULL == ptTargetMask){ - ptTask->Param.tFillMask.tDesMask.bInvalid = true; - } else { - ptTask->Param.tFillMask.tDesMask = *ptTargetMask; - } - - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - - - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptTarget, - arm_2d_size_t * ptCopySize) -{ - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 0, - .Param.tCopy = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - }; - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy_with_mask( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptSourceMask, - __arm_2d_tile_param_t *ptTarget, - __arm_2d_tile_param_t *ptTargetMask, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 0, - .Param.tCopyMask = { - .use_as____arm_2d_param_copy_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - }, - }; - - if (NULL == ptSourceMask){ - ptTask->Param.tCopyMask.tSrcMask.bInvalid = true; - } else { - ptTask->Param.tCopyMask.tSrcMask = *ptSourceMask; - } - - if (NULL == ptTargetMask){ - ptTask->Param.tCopyMask.tDesMask.bInvalid = true; - } else { - ptTask->Param.tCopyMask.tDesMask = *ptTargetMask; - } - - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_fill_origin( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptOrigin, - __arm_2d_tile_param_t *ptTarget) -{ - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 1, - .Param.tFillOrig = { - .use_as____arm_2d_param_fill_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - }, - .tOrigin = *ptOrigin, - }, - }; - - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy_origin( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptOrigin, - __arm_2d_tile_param_t *ptTarget, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 0, - .Param.tCopyOrig = { - .use_as____arm_2d_param_copy_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - .tOrigin = *ptOrigin, - }, - }; - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - - -__OVERRIDE_WEAK -arm_fsm_rt_t __arm_2d_issue_sub_task_copy_origin_masks( - arm_2d_op_cp_t *ptThis, - __arm_2d_tile_param_t *ptSource, - __arm_2d_tile_param_t *ptOrigin, - __arm_2d_tile_param_t *ptOriginMask, - __arm_2d_tile_param_t *ptTarget, - __arm_2d_tile_param_t *ptTargetMask, - arm_2d_size_t * __RESTRICT ptCopySize) -{ - __arm_2d_sub_task_t *ptTask = __arm_2d_sub_task_new(); - assert(NULL != ptTask); - - (*ptTask) = (__arm_2d_sub_task_t) { - .ptOP = &(ptThis->use_as__arm_2d_op_core_t), - .chLowLeveIOIndex = 0, - .Param.tCopyOrigMask = { - .use_as____arm_2d_param_copy_orig_t = { - .use_as____arm_2d_param_copy_t = { - .tSource = *ptSource, - .tTarget = *ptTarget, - .tCopySize = *ptCopySize, - }, - - .tOrigin = *ptOrigin, - }, - .tOrigMask = *ptOriginMask, - .tDesMask = *ptTargetMask, - }, - }; - OP_CORE.Status.u4SubTaskCount++; - - __arm_2d_sub_task_add(ptTask); - - return arm_fsm_rt_async; -} - - - -/*! - * \brief initialise the arm-2d pipeline - * \param ptSubTasks an array of __arm_2d_sub_task_t objects - * \param hwCount the number of items in the array - * \return arm_2d_err_t error code - */ -arm_2d_err_t __arm_2d_async_init( __arm_2d_sub_task_t *ptSubTasks, - uint_fast16_t hwCount) -{ - - if ((NULL == ptSubTasks) || (0 == hwCount )) { - return ARM_2D_ERR_INSUFFICIENT_RESOURCE; - } - - //! initialise sub task pool - do { - __arm_2d_sub_task_free(ptSubTasks++); - } while(--hwCount); - - return ARM_2D_ERR_NONE; -} - - -__WEAK -bool arm_2d_port_wait_for_async(uintptr_t pUserParam) -{ - return false; -} - -__OVERRIDE_WEAK -/*! - * \brief wait asynchronouse operation complete - * \retval true sync up with operation - * \retval false operation is busy - */ -bool arm_2d_op_wait_async(arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_core_t, ptOP) - - volatile arm_2d_op_status_t *ptStatus - = (volatile arm_2d_op_status_t *)&(this.Status); - - bool bIsBusy = false; - do { - bIsBusy = ptStatus->bIsBusy; - - if (!bIsBusy) { - break; - } - - if (!arm_2d_port_wait_for_async(this.pUserParam)) { - break; - } - } while(bIsBusy); - - return !bIsBusy; -} - - -__OVERRIDE_WEAK -/*! \brief sync up with operation - *! \retval true operation is busy - *! \retval false operation isn't busy - */ -bool __arm_2d_op_acquire(arm_2d_op_core_t *ptOP) -{ - ARM_2D_IMPL(arm_2d_op_core_t, ptOP) - volatile arm_2d_op_status_t *ptStatus - = (volatile arm_2d_op_status_t *)&(this.Status); - - bool bResult = false; - do { - arm_irq_safe { - bResult = ptStatus->bIsBusy; - if (!bResult) { - this.tResult = arm_fsm_rt_async; - ptStatus->tValue = 0; //! reset status - ptStatus->bIsBusy = true; //! set busy flag - } - } - - if (!bResult) { - break; - } - - if (!arm_2d_port_wait_for_async(this.pUserParam)) { - break; - } - - } while (bResult); - - - - return !bResult; -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/package/Arm2D/Library/Source/arm_2d_conversion.c b/package/Arm2D/Library/Source/arm_2d_conversion.c deleted file mode 100644 index aaad5a491..000000000 --- a/package/Arm2D/Library/Source/arm_2d_conversion.c +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_draw.c - * Description: APIs for colour format conversion - * - * $Date: 08. Aug 2022 - * $Revision: V.1.0.2 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -/*============================ INCLUDES ======================================*/ -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wmissing-variable-declarations" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wswitch-enum" -# pragma clang diagnostic ignored "-Wswitch" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 174,177,188,68,513,144 -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ - -void __arm_2d_impl_gray8_to_rgb565( uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_cccn888_to_rgb565(uint32_t *__RESTRICT pwSource, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_rgb565_to_cccn888(uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint32_t *__RESTRICT pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_gray8_to_cccn888(uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint32_t *__RESTRICT pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_rgb565_to_gray8( uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint8_t *__RESTRICT pchTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); - -void __arm_2d_impl_cccn888_to_gray8(uint32_t *__RESTRICT pwSource, - int16_t iSourceStride, - uint8_t *__RESTRICT pchwTarget, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize); -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - - -/*----------------------------------------------------------------------------* - * Convert Colour format * - *----------------------------------------------------------------------------*/ - -/*! - * \brief convert the colour format of a given tile to rgb888 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[out] ptTarget the output tile (holding a buffer) - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_convert_colour_to_rgb888( arm_2d_op_cl_convt_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cl_convt_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_CONVERT_TO_RGB888; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = NULL; - this.Source.ptTile = ptSource; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief convert the colour format of a given tile to rgb565 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[out] ptTarget the output tile (holding a buffer) - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_convert_colour_to_rgb565( arm_2d_op_cl_convt_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cl_convt_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_CONVERT_TO_RGB565; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = NULL; - this.Source.ptTile = ptSource; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief convert the colour format of a given tile to gray8 - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptSource the source tile - * \param[out] ptTarget the output tile (holding a buffer) - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_convert_colour_to_gray8( arm_2d_op_cl_convt_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptTarget) -{ - assert(NULL != ptSource); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_cl_convt_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_CONVERT_TO_GRAY8; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = NULL; - this.Source.ptTile = ptSource; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_sw_convert_colour_to_gray8(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cl_convt_t, ptTask->ptOP); - - if (!this.Source.ptTile->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_MISSING_PARAM; - } - - - switch ( this.Source.ptTile->tInfo.tColourInfo.u3ColourSZ) { - case ARM_2D_COLOUR_8BIT: - /* no need to convert, return cpl directly */ - break; - case ARM_2D_COLOUR_SZ_16BIT: - __arm_2d_impl_rgb565_to_gray8( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize)); - break; - case ARM_2D_COLOUR_SZ_32BIT: - __arm_2d_impl_cccn888_to_gray8( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize)); - break; - default: - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - } - - return arm_fsm_rt_cpl; -} - - -arm_fsm_rt_t __arm_2d_sw_convert_colour_to_rgb565(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cl_convt_t, ptTask->ptOP); - - if (!this.Source.ptTile->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_MISSING_PARAM; - } - - - switch ( this.Source.ptTile->tInfo.tColourInfo.u3ColourSZ) { - case ARM_2D_COLOUR_8BIT: - __arm_2d_impl_gray8_to_rgb565( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize)); - break; - case ARM_2D_COLOUR_SZ_16BIT: - /* no need to convert, return cpl directly */ - break; - case ARM_2D_COLOUR_SZ_32BIT: - __arm_2d_impl_cccn888_to_rgb565( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize)); - break; - default: - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_sw_convert_colour_to_rgb888(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_cl_convt_t, ptTask->ptOP); - - if (!this.Source.ptTile->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_MISSING_PARAM; - } - - - switch ( this.Source.ptTile->tInfo.tColourInfo.u3ColourSZ) { - case ARM_2D_COLOUR_8BIT: - __arm_2d_impl_gray8_to_cccn888( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize)); - break; - case ARM_2D_COLOUR_SZ_16BIT: - __arm_2d_impl_rgb565_to_cccn888( ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &(ptTask->Param.tCopy.tCopySize)); - break; - case ARM_2D_COLOUR_SZ_32BIT: - /* no need to convert, return cpl directly */ - break; - default: - return (arm_fsm_rt_t)ARM_2D_ERR_UNSUPPORTED_COLOUR; - } - - return arm_fsm_rt_cpl; -} - -/*----------------------------------------------------------------------------* - * Accelerable Low Level APIs * - *----------------------------------------------------------------------------*/ - -__WEAK -void __arm_2d_impl_gray8_to_rgb565( uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint8_t *__RESTRICT pchSource = pchSourceBase; - uint16_t *__RESTRICT phwTarget = phwTargetBase; - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - __arm_2d_color_fast_rgb_t hwTargetPixel; - - uint_fast8_t chColour = *pchSource++; - - hwTargetPixel.R = chColour; - hwTargetPixel.G = chColour; - hwTargetPixel.B = chColour; - - *phwTarget++ = __arm_2d_rgb565_pack(&hwTargetPixel); - } - - pchSourceBase += iSourceStride; - phwTargetBase += iTargetStride; - } -} - -__WEAK -void __arm_2d_impl_cccn888_to_rgb565(uint32_t *__RESTRICT pwSourceBase, - int16_t iSourceStride, - uint16_t *__RESTRICT phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint32_t *__RESTRICT pwSource = pwSourceBase; - uint16_t *__RESTRICT phwTarget = phwTargetBase; - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - arm_2d_color_bgra8888_t wSrcPixel; - __arm_2d_color_fast_rgb_t hwTargetPixel; - - wSrcPixel.tValue = *pwSource++; - hwTargetPixel.R = wSrcPixel.u8R; - hwTargetPixel.G = wSrcPixel.u8G; - hwTargetPixel.B = wSrcPixel.u8B; - - *phwTarget++ = __arm_2d_rgb565_pack(&hwTargetPixel); - } - - pwSourceBase += iSourceStride; - phwTargetBase += iTargetStride; - } -} - -__WEAK -void __arm_2d_impl_gray8_to_cccn888(uint8_t *__RESTRICT pchSourceBase, - int16_t iSourceStride, - uint32_t *__RESTRICT pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint8_t *__RESTRICT pchSource = pchSourceBase; - uint32_t *__RESTRICT pwTarget = pwTargetBase; - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - - uint_fast8_t chPixel = *pchSource++; - arm_2d_color_bgra8888_t wTargetPixel; - - wTargetPixel.u8R = chPixel; - wTargetPixel.u8G = chPixel; - wTargetPixel.u8B = chPixel; - wTargetPixel.u8A = 0xFF; - *pwTarget++ = wTargetPixel.tValue; - } - - pchSourceBase += iSourceStride; - pwTargetBase += iTargetStride; - } -} - -__WEAK -void __arm_2d_impl_rgb565_to_cccn888(uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint32_t *__RESTRICT pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint16_t *__RESTRICT phwSource = phwSourceBase; - uint32_t *__RESTRICT pwTarget = pwTargetBase; - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - __arm_2d_color_fast_rgb_t hwSrcPixel; - arm_2d_color_bgra8888_t wTargetPixel; - - __arm_2d_rgb565_unpack(*phwSource++, &hwSrcPixel); - wTargetPixel.u8R = hwSrcPixel.R; - wTargetPixel.u8G = hwSrcPixel.G; - wTargetPixel.u8B = hwSrcPixel.B; - wTargetPixel.u8A = 0xFF; - *pwTarget++ = wTargetPixel.tValue; - } - - phwSourceBase += iSourceStride; - pwTargetBase += iTargetStride; - } -} - - - -__WEAK -void __arm_2d_impl_rgb565_to_gray8( uint16_t *__RESTRICT phwSourceBase, - int16_t iSourceStride, - uint8_t *__RESTRICT pchTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint16_t *__RESTRICT phwSource = phwSourceBase; - uint8_t *__RESTRICT pchTarget = pchTargetBase; - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - __arm_2d_color_fast_rgb_t hwSrcPixel; - uint_fast16_t hwPixel = 0; - - __arm_2d_rgb565_unpack(*phwSource++, &hwSrcPixel); - hwPixel += hwSrcPixel.R; - hwPixel += hwSrcPixel.G; - hwPixel += hwSrcPixel.B; - - *pchTarget++ = hwPixel / 3; - } - - phwSourceBase += iSourceStride; - pchTargetBase += iTargetStride; - } -} - -__WEAK -void __arm_2d_impl_cccn888_to_gray8(uint32_t *__RESTRICT pwSourceBase, - int16_t iSourceStride, - uint8_t *__RESTRICT pchTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize) -{ - for (int_fast16_t y = 0; y < ptCopySize->iHeight; y++) { - - const uint32_t *__RESTRICT pwSource = pwSourceBase; - uint8_t *__RESTRICT pchTarget = pchTargetBase; - - for (int_fast16_t x = 0; x < ptCopySize->iWidth; x++) { - arm_2d_color_bgra8888_t wSrcPixel; - uint_fast16_t hwPixel = 0; - - wSrcPixel.tValue = *pwSource++; - hwPixel += wSrcPixel.u8R; - hwPixel += wSrcPixel.u8G; - hwPixel += wSrcPixel.u8B; - - *pchTarget++ = hwPixel / 3; - } - - pwSourceBase += iSourceStride; - pchTargetBase += iTargetStride; - } -} - -/*----------------------------------------------------------------------------* - * Low Level IO Interfaces * - *----------------------------------------------------------------------------*/ -__WEAK -def_low_lv_io( __ARM_2D_IO_COLOUR_CONVERT_TO_GRAY8, - __arm_2d_sw_convert_colour_to_gray8); -__WEAK -def_low_lv_io( __ARM_2D_IO_COLOUR_CONVERT_TO_RGB565, - __arm_2d_sw_convert_colour_to_rgb565); -__WEAK -def_low_lv_io( __ARM_2D_IO_COLOUR_CONVERT_TO_RGB888, - __arm_2d_sw_convert_colour_to_rgb888); - - -const __arm_2d_op_info_t ARM_2D_OP_CONVERT_TO_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COLOUR_FORMAT_CONVERSION, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COLOUR_CONVERT_TO_GRAY8), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_CONVERT_TO_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COLOUR_FORMAT_CONVERSION, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COLOUR_CONVERT_TO_RGB565), - .ptFillLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_CONVERT_TO_RGB888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_COLOUR_FORMAT_CONVERSION, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_COLOUR_CONVERT_TO_RGB888), - .ptFillLike = NULL, - }, - }, -}; - -#ifdef __cplusplus -} -#endif diff --git a/package/Arm2D/Library/Source/arm_2d_draw.c b/package/Arm2D/Library/Source/arm_2d_draw.c deleted file mode 100644 index c6377137a..000000000 --- a/package/Arm2D/Library/Source/arm_2d_draw.c +++ /dev/null @@ -1,913 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_draw.c - * Description: APIs for basic drawing - * - * $Date: 21. April 2022 - * $Revision: V.1.0.0 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -/*============================ INCLUDES ======================================*/ -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wmissing-variable-declarations" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wswitch-enum" -# pragma clang diagnostic ignored "-Wswitch" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 174,177,188,68,513,144 -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - -/*----------------------------------------------------------------------------* - * Accelerable Low Level APIs * - *----------------------------------------------------------------------------*/ - -/*! adding support with c code template */ - -#define __API_COLOUR c8bit -#define __API_INT_TYPE uint8_t - -#include "__arm_2d_fill_colour.inc" - -#define __API_COLOUR rgb16 -#define __API_INT_TYPE uint16_t - -#include "__arm_2d_fill_colour.inc" - - -#define __API_COLOUR rgb32 -#define __API_INT_TYPE uint32_t - -#include "__arm_2d_fill_colour.inc" - - -/*! adding support with c code template */ -#define __API_COLOUR c8bit -#define __API_INT_TYPE uint8_t -#include "__arm_2d_draw_pattern.inc" - -#define __API_COLOUR rgb16 -#define __API_INT_TYPE uint16_t -#include "__arm_2d_draw_pattern.inc" - - -#define __API_COLOUR rgb32 -#define __API_INT_TYPE uint32_t -#include "__arm_2d_draw_pattern.inc" - - -/*----------------------------------------------------------------------------* - * Draw a point with specified colour * - *----------------------------------------------------------------------------*/ - -/*! - * \brief draw a point with a given 8bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \param[in] chColour an 8bit colour - * \return arm_fsm_rt_t the operation result - * - * \note As those draw point APIs involve the region calculation - * which is only useful when partial framebuffer is used, it is slow. - * For gettting better performance, if the target tile is root and the - * target location is inside the target region, please use the - * functions with "_fast" posfix. - * - */ -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_c8bit_draw_point( arm_2d_op_drw_pt_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint_fast8_t chColour) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_drw_pt_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - arm_2d_region_t tPointRegion = { - .tLocation = tLocation, - .tSize = {1,1}, - }; - - OP_CORE.ptOp = &ARM_2D_OP_DRAW_POINT_C8BIT; - OP_CORE.Preference.u2ACCMethods = ARM_2D_PREF_ACC_SW_ONLY; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = &tPointRegion; - this.chColour = chColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief draw a point with a given 16bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \param[in] hwColour an 16bit colour - * \return arm_fsm_rt_t the operation result - * - * \note As those draw point APIs involve the region calculation - * which is only useful when partial framebuffer is used, it is slow. - * For gettting better performance, if the target tile is root and the - * target location is inside the target region, please use the - * functions with "_fast" posfix. - * - */ -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb16_draw_point( arm_2d_op_drw_pt_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint_fast16_t hwColour) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_drw_pt_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - arm_2d_region_t tPointRegion = { - .tLocation = tLocation, - .tSize = {1,1}, - }; - - OP_CORE.ptOp = &ARM_2D_OP_DRAW_POINT_RGB16; - OP_CORE.Preference.u2ACCMethods = ARM_2D_PREF_ACC_SW_ONLY; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = &tPointRegion; - this.hwColour = hwColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief draw a point with a given 32bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target root tile - * \param[in] tLocation the target location - * \param[in] wColour an 32bit colour - * \return arm_fsm_rt_t the operation result - * - * \note As those draw point APIs involve the region calculation - * which is only useful when partial framebuffer is used, it is slow. - * For gettting better performance, if the target tile is root and the - * target location is inside the target region, please use the - * functions with "_fast" posfix. - * - */ -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb32_draw_point( arm_2d_op_drw_pt_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_location_t tLocation, - uint32_t wColour) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_drw_pt_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - arm_2d_region_t tPointRegion = { - .tLocation = tLocation, - .tSize = {1,1}, - }; - - OP_CORE.ptOp = &ARM_2D_OP_DRAW_POINT_RGB32; - OP_CORE.Preference.u2ACCMethods = ARM_2D_PREF_ACC_SW_ONLY; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = &tPointRegion; - this.wColour = wColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_sw_draw_point(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_drw_pt_t, ptTask->ptOP) - - switch (OP_CORE.ptOp->Info.Colour.u3ColourSZ) { - case ARM_2D_COLOUR_SZ_8BIT: - (*(uint8_t *)ptTask->Param.tTileProcess.pBuffer) = this.chColour; - break; - case ARM_2D_COLOUR_SZ_16BIT: - (*(uint16_t *)ptTask->Param.tTileProcess.pBuffer) = this.hwColour; - break; - case ARM_2D_COLOUR_SZ_32BIT: - (*(uint32_t *)ptTask->Param.tTileProcess.pBuffer) = this.wColour; - break; - default: - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } - - return arm_fsm_rt_cpl; -} - - -/*----------------------------------------------------------------------------* - * Fill tile with a specified colour * - *----------------------------------------------------------------------------*/ - -/*! - * \brief fill the target region with a given 8bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] chColour a 8bit colour - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_c8bit_fill_colour( arm_2d_op_fill_cl_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast8_t chColour) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_fill_cl_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.chColour = chColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief fill the target region with a given 16bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] hwColour a 16bit colour - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb16_fill_colour( arm_2d_op_fill_cl_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint_fast16_t hwColour) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_fill_cl_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.hwColour = hwColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief fill the target region with a given 32bit colour - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wColour a 32bit colour - * \return arm_fsm_rt_t the operations result - */ -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_rgb32_fill_colour( arm_2d_op_fill_cl_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wColour) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_fill_cl_t, ptOP); - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_FILL_COLOUR_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.wColour = wColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -arm_fsm_rt_t __arm_2d_c8bit_sw_colour_filling(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_c8bit_colour_filling( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.chColour); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_colour_filling(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb16_colour_filling( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.hwColour); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_colour_filling(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_fill_cl_t, ptTask->ptOP) - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - __arm_2d_impl_rgb32_colour_filling( - ptTask->Param.tTileProcess.pBuffer, - ptTask->Param.tTileProcess.iStride, - &(ptTask->Param.tTileProcess.tValidRegion.tSize), - this.wColour); - - return arm_fsm_rt_cpl; -} - - -/*----------------------------------------------------------------------------* - * Draw a bit patterns * - *----------------------------------------------------------------------------*/ - -/*! - * \brief copy a bit-pattern with given 8bit colours - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptPattern the source bit pattern - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \param[in] chForeColour the foreground colour - * \param[in] chBackColour the background colour - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_c8bit_draw_pattern( arm_2d_op_drw_patn_t *ptOP, - const arm_2d_tile_t *ptPattern, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode, - uint8_t chForeColour, - uint8_t chBackColour) -{ - assert(NULL != ptPattern); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_drw_patn_t, ptOP); - - - if ( (wMode & (ARM_2D_DRW_PATN_MODE_NO_FG_COLOR | - ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR | - ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR )) - == (ARM_2D_DRW_PATN_MODE_NO_FG_COLOR)) { - - //! nothing todo - return arm_fsm_rt_cpl; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_DRAW_PATTERN_C8BIT; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptPattern; - this.wMode = wMode; - this.Foreground.chColour = chForeColour; - this.Background.chColour = chBackColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief copy a bit-pattern with given 16bit colours - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptPattern the source bit pattern - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \param[in] hwForeColour the foreground colour - * \param[in] hwBackColour the background colour - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb16_draw_pattern( arm_2d_op_drw_patn_t *ptOP, - const arm_2d_tile_t *ptPattern, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode, - uint16_t hwForeColour, - uint16_t hwBackColour) -{ - assert(NULL != ptPattern); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_drw_patn_t, ptOP); - - if ( (wMode & (ARM_2D_DRW_PATN_MODE_NO_FG_COLOR | - ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR | - ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR )) - == (ARM_2D_DRW_PATN_MODE_NO_FG_COLOR)) { - - //! nothing todo - return arm_fsm_rt_cpl; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - OP_CORE.ptOp = &ARM_2D_OP_DRAW_PATTERN_RGB16; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptPattern; - this.wMode = wMode; - this.Foreground.hwColour = hwForeColour; - this.Background.hwColour = hwBackColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - -/*! - * \brief copy a bit-pattern with given 32bit colours - * \param[in] ptOP the control block, NULL means using the default control block - * \param[in] ptPattern the source bit pattern - * \param[in] ptTarget the target tile - * \param[in] ptRegion the target region - * \param[in] wMode the copy mode - * \param[in] wForeColour the foreground colour - * \param[in] wBackColour the background colour - * \return arm_fsm_rt_t the operation result - */ -ARM_NONNULL(2,3) -arm_fsm_rt_t arm_2dp_rgb32_draw_pattern(arm_2d_op_drw_patn_t *ptOP, - const arm_2d_tile_t *ptPattern, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - uint32_t wMode, - uint32_t wForeColour, - uint32_t wBackColour) -{ - - assert(NULL != ptPattern); - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_drw_patn_t, ptOP); - - - if ( (wMode & (ARM_2D_DRW_PATN_MODE_NO_FG_COLOR | - ARM_2D_DRW_PATH_MODE_COMP_FG_COLOUR | - ARM_2D_DRW_PATN_MODE_WITH_BG_COLOR )) - == (ARM_2D_DRW_PATN_MODE_NO_FG_COLOR)) { - - //! nothing todo - return arm_fsm_rt_cpl; - } - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - //memset(ptThis, 0, sizeof(*ptThis)); - - - OP_CORE.ptOp = &ARM_2D_OP_DRAW_PATTERN_RGB32; - - this.Target.ptTile = ptTarget; - this.Target.ptRegion = ptRegion; - this.Source.ptTile = ptPattern; - this.wMode = wMode; - this.Foreground.wColour = wForeColour; - this.Background.wColour = wBackColour; - - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - -arm_fsm_rt_t __arm_2d_c8bit_sw_draw_pattern( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_drw_patn_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_8BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - uint32_t wMode = this.wMode; - -#if 0 - if (!this.Source.ptTile->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } - - if (ARM_2D_COLOUR_SZ_1BIT != this.Source.ptTile->tColourInfo.u3ColourSZ) { - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } -#endif - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - #if 0 - //! todo: add support for mirror - __arm_2d_impl_c8bit_draw_pattern_with_mirror( - ptTask->Param.tCopy.pSource , - ptTask->Param.tCopy.iSourceStride, - ptTask->Param.tCopy.pTarget, - ptTask->Param.tCopy.iTargetStride, - &ptTask->Param.tCopy.tCopySize, - wMode); - break; - #else - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - #endif - } else { - //! draw bit-pattern - __arm_2d_impl_c8bit_draw_pattern( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.nOffset, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode, - this.Foreground.hwColour, - this.Background.hwColour); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb16_sw_draw_pattern( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_drw_patn_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_16BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - uint32_t wMode = this.wMode; - -#if 0 - if (!this.Source.ptTile->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } - - if (ARM_2D_COLOUR_SZ_1BIT != this.Source.ptTile->tColourInfo.u3ColourSZ) { - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } -#endif - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - #if 0 - //! todo: add support for mirror - __arm_2d_impl_rgb16_draw_pattern_with_mirror( - ptTask->Param.tCopy.pSource , - ptTask->Param.tCopy.iSourceStride, - ptTask->Param.tCopy.pTarget, - ptTask->Param.tCopy.iTargetStride, - &ptTask->Param.tCopy.tCopySize, - wMode); - break; - #else - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - #endif - } else { - //! draw bit-pattern - __arm_2d_impl_rgb16_draw_pattern( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.nOffset, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode, - this.Foreground.hwColour, - this.Background.hwColour); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb32_sw_draw_pattern( __arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_drw_patn_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - uint32_t wMode = this.wMode; - -#if 0 - if (!this.Source.ptTile->bHasEnforcedColour) { - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } - - if (ARM_2D_COLOUR_SZ_1BIT != this.Source.ptTile->tColourInfo.u3ColourSZ) { - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - } -#endif - - if (wMode & (ARM_2D_CP_MODE_Y_MIRROR | ARM_2D_CP_MODE_X_MIRROR)) { - #if 0 - //! todo: add support for mirror - __arm_2d_impl_rgb32_draw_pattern_with_mirror( - ptTask->Param.tCopy.pSource , - ptTask->Param.tCopy.iSourceStride, - ptTask->Param.tCopy.pTarget, - ptTask->Param.tCopy.iTargetStride, - &ptTask->Param.tCopy.tCopySize, - wMode); - #else - return (arm_fsm_rt_t)ARM_2D_ERR_NOT_SUPPORT; - #endif - } else { - __arm_2d_impl_rgb32_draw_pattern( - ptTask->Param.tCopy.tSource.pBuffer, - ptTask->Param.tCopy.tSource.nOffset, - ptTask->Param.tCopy.tSource.iStride, - ptTask->Param.tCopy.tTarget.pBuffer, - ptTask->Param.tCopy.tTarget.iStride, - &ptTask->Param.tCopy.tCopySize, - wMode, - this.Foreground.wColour, - this.Background.wColour); - } - - return arm_fsm_rt_cpl; -} - - - -/*----------------------------------------------------------------------------* - * Low Level IO Interfaces * - *----------------------------------------------------------------------------*/ - -__WEAK -def_low_lv_io(__ARM_2D_IO_DRAW_POINT, __arm_2d_sw_draw_point); - -__WEAK -def_low_lv_io(__ARM_2D_IO_DRAW_PATTERN_C8BIT, __arm_2d_c8bit_sw_draw_pattern); -__WEAK -def_low_lv_io(__ARM_2D_IO_DRAW_PATTERN_RGB16, __arm_2d_rgb16_sw_draw_pattern); -__WEAK -def_low_lv_io(__ARM_2D_IO_DRAW_PATTERN_RGB32, __arm_2d_rgb32_sw_draw_pattern); - -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_C8BIT, __arm_2d_c8bit_sw_colour_filling); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_RGB16, __arm_2d_rgb16_sw_colour_filling); -__WEAK -def_low_lv_io(__ARM_2D_IO_FILL_COLOUR_RGB32, __arm_2d_rgb32_sw_colour_filling); - - -const __arm_2d_op_info_t ARM_2D_OP_DRAW_POINT_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_DRAW_POINT, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_DRAW_POINT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_DRAW_POINT_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB16, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_DRAW_POINT, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_DRAW_POINT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_DRAW_POINT_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB32, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_DRAW_POINT, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_DRAW_POINT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_DRAW_PATTERN_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_DRAW_PATTERN, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_DRAW_PATTERN_C8BIT), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_DRAW_PATTERN_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB16, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_DRAW_PATTERN, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_DRAW_PATTERN_RGB16), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_DRAW_PATTERN_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB32, - }, - .Param = { - .bHasSource = true, - .bHasTarget = true, - .bAllowEnforcedColour = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_DRAW_PATTERN, - - .LowLevelIO = { - .ptCopyLike = ref_low_lv_io(__ARM_2D_IO_DRAW_PATTERN_RGB32), - .ptFillLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_C8BIT = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_C8BIT), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_RGB16 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB16, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_RGB16), - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_FILL_COLOUR_RGB32 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB32, - }, - .Param = { - .bHasSource = false, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_FILL_COLOUR, - - .LowLevelIO = { - .ptTileProcessLike = ref_low_lv_io(__ARM_2D_IO_FILL_COLOUR_RGB32), - }, - }, -}; - -#ifdef __cplusplus -} -#endif diff --git a/package/Arm2D/Library/Source/arm_2d_helium.c b/package/Arm2D/Library/Source/arm_2d_helium.c deleted file mode 100644 index afe03698b..000000000 --- a/package/Arm2D/Library/Source/arm_2d_helium.c +++ /dev/null @@ -1,3932 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_helium.c - * Description: Acceleration extensions using Helium. - * - * $Date: 03. Aug 2022 - * $Revision: V.0.13.6 - * - * Target Processor: Cortex-M cores with Helium - * - * -------------------------------------------------------------------- */ - -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" - -#if defined(__ARM_2D_HAS_HELIUM__) && __ARM_2D_HAS_HELIUM__ - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wvector-conversion" -# pragma clang diagnostic ignored "-Wundef" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#endif - - -/*============================ INCLUDES ======================================*/ - -#include "__arm_2d_paving_helium.h" -#include "__arm_2d_math_helium.h" -#include "__arm_2d_utils_helium.h" -#ifdef __cplusplus -extern "C" { -#endif - -/*============================ MACROS ========================================*/ -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - -/*! - * \brief initialise the helium acceleration - */ -void __arm_2d_helium_init(void) -{ - /* even if this is empty, do not remove it */ -} - - -/*----------------------------------------------------------------------------* - * Code Template for tile operations * - *----------------------------------------------------------------------------*/ - -#define __API_COLOUR c8bit -#define __API_INT_TYPE uint8_t -#define __API_INT_TYPE_BIT_NUM 8 - -#include "__arm_2d_copy_helium.inc" - -#define __API_COLOUR rgb16 -#define __API_INT_TYPE uint16_t -#define __API_INT_TYPE_BIT_NUM 16 - -#include "__arm_2d_copy_helium.inc" - - -#define __API_COLOUR rgb32 -#define __API_INT_TYPE uint32_t -#define __API_INT_TYPE_BIT_NUM 32 - -#include "__arm_2d_copy_helium.inc" - - -#define __ARM_2D_COMPILATION_UNIT -#include "__arm_2d_transform_helium.c" - -#define __ARM_2D_COMPILATION_UNIT -#include "__arm_2d_conversion_helium.c" - -/*----------------------------------------------------------------------------* - * Helper - *----------------------------------------------------------------------------*/ - -__OVERRIDE_WEAK -void __MVE_WRAPPER(arm_2d_helper_swap_rgb16)(uint16_t *phwBuffer, uint32_t wCount) -{ - if (0 == wCount) { - return ; - } - - // aligned (2) - assert((((uintptr_t) phwBuffer) & 0x01) == 0); - - // src not aligned to 32-bit - // (helium supports unaligned vector load & store but with extra cycle penalty) - if ((((uintptr_t) phwBuffer) & 0x03) == 0x02) { - // handle the leading pixel - uint32_t wTemp = *phwBuffer; - *phwBuffer++ = (uint16_t)__REV16(wTemp); - wCount--; - } - -#ifdef USE_MVE_INTRINSICS - do { - mve_pred16_t tailPred = vctp16q(wCount); - uint16x8_t rgb16vec = vld1q_z(phwBuffer, tailPred); - - rgb16vec = (uint16x8_t)vrev16q_m_u8(rgb16vec, rgb16vec, tailPred); - - vst1q_p(phwBuffer , rgb16vec , tailPred); - - phwBuffer += 8; - wCount -= 8; - } - while ((int32_t)wCount > 0); - -#else - __asm volatile( - ".p2align 2 \n" - " wlstp.16 lr, %[wCount], 1f \n" - "2: \n" - - " vldrh.u16 q0, [%[phwBuffer]] \n" - " vrev16.8 q0, q0 \n" - " vstrh.u16 q0, [%[phwBuffer]], #16 \n" - " letp lr, 2b \n" - "1: \n" - - : [phwBuffer] "+r"(phwBuffer) - : [wCount] "r" (wCount) - :"q0", "lr", "memory"); -#endif -} - - - -/*----------------------------------------------------------------------------* - * Specialized Copy Routines * - *----------------------------------------------------------------------------*/ - - -static -void __arm_copy_16_mve_narrow( uint16_t *phwSource, - int16_t iSourceStride, - uint16_t *phwTarget, - int16_t iTargetStride, - arm_2d_size_t *ptCopySize) -{ -#ifdef USE_MVE_INTRINSICS - for (int32_t x = 0; x < ptCopySize->iWidth; x++) { - uint16x8_t srcStr = vidupq_u16((uint32_t) 0, 1); - uint16x8_t dstStr = vidupq_u16((uint32_t) 0, 1); - - srcStr = srcStr * iSourceStride; - dstStr = dstStr * iTargetStride; - - for (int32_t y = 0; y < ptCopySize->iHeight / 8; y++) { - uint16x8_t in = vldrhq_gather_shifted_offset_u16(phwSource, srcStr); - srcStr = vaddq_n_u16(srcStr, (8 * iSourceStride)); - - vstrhq_scatter_shifted_offset_u16(phwTarget, dstStr, in); - dstStr = vaddq_n_u16(dstStr, (8 * iTargetStride)); - } - - phwSource++; - phwTarget++; - } -#else - __asm volatile( - " clrm {r2, r4} \n" - " vidup.u16 q0, r2, #1 \n" - " vmul.i16 q2, q0, %[iSourceStride] \n" - " vidup.u16 q1, r4, #1 \n" - " vmul.i16 q3, q1, %[iTargetStride] \n" - - "3: \n" - /* outer loop, iterates over columns */ - /* size = ptCopySize->iWidth */ - " vmov q0, q2 \n" - " vmov q1, q3 \n" - - /* inner loop, iterates over rows (size = ptCopySize->iHeight) */ - " wlstp.16 lr, %[iHeight], 1f \n" - ".p2align 2 \n" - "2: \n" - " vldrh.u16 q4, [%[phwSource], q0, uxtw #1] \n" - " vadd.i16 q0, q0, %[iSourceStridex8] \n" - " vstrh.16 q4, [%[phwTarget], q1, uxtw #1] \n" - " vadd.i16 q1, q1, %[iTargetStridex8] \n" - " letp lr, 2b \n" - "1: \n" - - " add.n %[phwSource], #2 \n" - " add.n %[phwTarget], #2 \n" - " subs %[iWidth], #1 \n" - " bne 3b \n" - - : [phwTarget] "+r"(phwTarget), [phwSource] "+r"(phwSource) - : [iHeight] "r"(ptCopySize->iHeight), [iWidth] "r" (ptCopySize->iWidth), - [iSourceStride] "r" (iSourceStride),[iSourceStridex8] "r" (iSourceStride*8), - [iTargetStride] "r" (iTargetStride),[iTargetStridex8] "r" (iTargetStride*8) - : "r2", "r4", "q0", "q1", "q2", "q3", "q4", "memory", "r14", "cc"); -#endif -} - -static -void __arm_copy_32_mve_narrow( uint32_t *pwSource, - int32_t iSourceStride, - uint32_t *pwTarget, - int32_t iTargetStride, - arm_2d_size_t *ptCopySize) -{ -#ifdef USE_MVE_INTRINSICS - for (int_fast32_t x = 0; x < ptCopySize->iWidth; x++) { - uint32x4_t srcStr = vidupq_u32((uint32_t) 0, 1); - uint32x4_t dstStr = vidupq_u32((uint32_t) 0, 1); - - srcStr = srcStr * iSourceStride; - dstStr = dstStr * iTargetStride; - - for (int_fast32_t y = 0; y < ptCopySize->iHeight / 4; y++) { - uint32x4_t in = vldrwq_gather_shifted_offset_u32(pwSource, srcStr); - srcStr = vaddq_n_u32(srcStr, (4 * iSourceStride)); - - vstrwq_scatter_shifted_offset_u32(pwTarget, dstStr, in); - dstStr = vaddq_n_u32(dstStr, (4 * iTargetStride)); - } - - pwSource++; - pwTarget++; - } -#else - __asm volatile( - - " clrm {r2, r4} \n" - " vidup.u32 q0, r2, #1 \n" - " vmul.i32 q2, q0, %[iSourceStride] \n" - " vidup.u32 q1, r4, #1 \n" - " vmul.i32 q3, q1, %[iTargetStride] \n" - - "3: \n" - /* outer loop, iterates over columns */ - /* size = ptCopySize->iWidth */ - " vmov q0, q2 \n" - " vmov q1, q3 \n" - - /* inner loop, iterates over rows (size = ptCopySize->iHeight) */ - " wlstp.32 lr, %[iHeight], 1f \n" - ".p2align 2 \n" - "2: \n" - " vldrw.u32 q4, [%[pwSource], q0, uxtw #2] \n" - " vadd.i32 q0, q0, %[iSourceStridex4] \n" - " vstrw.32 q4, [%[pwTarget], q1, uxtw #2] \n" - " vadd.i32 q1, q1, %[iTargetStridex4] \n" - " letp lr, 2b \n" - "1: \n" - - " add.n %[pwSource], #4 \n" - " add.n %[pwTarget], #4 \n" - " subs %[iWidth], #1 \n" - " bne 3b \n" - - : [pwTarget] "+r"(pwTarget), [pwSource] "+r"(pwSource) - : [iHeight] "r"(ptCopySize->iHeight), [iWidth] "r" (ptCopySize->iWidth), - [iSourceStride] "r" (iSourceStride),[iSourceStridex4] "r" (iSourceStride*4), - [iTargetStride] "r" (iTargetStride),[iTargetStridex4] "r" (iTargetStride*4) - : "r2", "r4", "q0", "q1", "q2", "q3", "q4", "memory", "r14", "cc"); -#endif -} - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb16_copy)( uint16_t *phwSource, - int16_t iSourceStride, - uint16_t *phwTarget, - int16_t iTargetStride, - arm_2d_size_t *ptCopySize) -{ - /* - * 16-bit Narrow copy case: - * use column copy with scatter / gather - */ - if(ptCopySize->iWidth <= 4) { - __arm_copy_16_mve_narrow(phwSource, - iSourceStride, - phwTarget, - iTargetStride, - ptCopySize); - - } else if((((uint32_t)phwSource & 3) == 0) && (((uint32_t)phwTarget & 3) == 0) - && ((iSourceStride & 3) == 0) && ((iTargetStride & 3) ==0)) { - /* - * source / dst & strides are 64-bit aligned - * use scalar LDRD/STRD, faster than back to back vector VLDR/VSTR on M55 - */ - __asm volatile( - "3: \n" - - " mov r0, %[phwSource] \n" - " mov r1, %[phwTarget] \n" - - /* scalar version faster (no DTCM bank conflict)*/ - " wls lr, %[iWidth], 1f \n" - ".p2align 2 \n" - "2: \n" - " ldrd r2, r3, [r0], #8 \n" - " strd r2, r3, [r1], #8 \n" - " le lr, 2b \n" - "1: \n" - // tail - " wls lr, %[iWidthTail], 1f \n" - ".p2align 2 \n" - "2: \n" - " ldrh r2, [r0], #2 \n" - " strh r2, [r1], #2 \n" - " le lr, 2b \n" - "1: \n" - - " add %[phwSource], %[iSourceStride] \n" - " add %[phwTarget], %[iTargetStride] \n" - " subs %[iHeight], #1 \n" - " bne 3b \n" - - : [phwTarget] "+r"(phwTarget), [phwSource] "+r"(phwSource) - : [iHeight] "r"(ptCopySize->iHeight), [iWidth] "r" (ptCopySize->iWidth/4), - [iWidthTail] "r" (ptCopySize->iWidth & 3), - [iSourceStride] "r" (iSourceStride*sizeof(uint16_t)), - [iTargetStride] "r" (iTargetStride*sizeof(uint16_t)) - : "r0", "r1", "r2", "r3", "q0", "memory", "r14", "cc" - ); - } - else - { - /* - * generic column major 16-bit 2D copy - */ - int32_t iWidth = ptCopySize->iWidth; - int32_t iHeight = ptCopySize->iHeight; - - __asm volatile( - " mov r2, %[iHeight] \n" - "3: \n" - - " mov r0, %[phwSource] \n" - " mov r1, %[phwTarget] \n" - - " wlstp.16 lr, %[iWidth], 1f \n" - ".p2align 2 \n" - "2: \n" - " vldrh.u16 q0, [r0], #16 \n" - " vstrh.16 q0, [r1], #16 \n" - " letp lr, 2b \n" - "1: \n" - " add %[phwSource], %[iSourceStride] \n" - " add %[phwTarget], %[iTargetStride] \n" - " subs r2, #1 \n" - " bne 3b \n" - - : [phwTarget] "+r"(phwTarget), [phwSource] "+r"(phwSource) - : [iHeight] "r"(iHeight), [iWidth] "r" (iWidth), - [iSourceStride] "r" (iSourceStride*sizeof(uint16_t)), - [iTargetStride] "r" (iTargetStride*sizeof(uint16_t)) - : "r0", "r1", "r2", "q0", "memory", "r14", "cc"); - } -} - -__OVERRIDE_WEAK - void __MVE_WRAPPER( __arm_2d_impl_rgb32_copy)( uint32_t *pwSource, - int16_t iSourceStride, - uint32_t *pwTarget, - int16_t iTargetStride, - arm_2d_size_t *ptCopySize) -{ - if(ptCopySize->iWidth <= 2) { - /* - * 32-bit Narrow copy case: - * use column copy with scatter / gather - */ - __arm_copy_32_mve_narrow(pwSource, - iSourceStride, - pwTarget, - iTargetStride, - ptCopySize); - - } else if((((uint32_t)pwSource & 3) == 0) && (((uint32_t)pwTarget & 3) == 0) - && ((iSourceStride & 3) == 0) && ((iTargetStride & 3) ==0)) { - /* - * source / dst & strides are 64-bit aligned - * use scalar LDRD/STRD, faster than back to back vector VLDR/VSTR on M55 - */ - __asm volatile( - "3: \n" - " mov r0, %[pwSource] \n" - " mov r1, %[pwTarget] \n" - - /* scalar version faster (no DTCM bank conflict)*/ - " wls lr, %[iWidth], 1f \n" - ".p2align 2 \n" - "2: \n" - " ldrd r2, r3, [r0], #8 \n" - " strd r2, r3, [r1], #8 \n" - " le lr, 2b \n" - "1: \n" - // tail - " wls lr, %[iWidthTail], 1f \n" - ".p2align 2 \n" - "2: \n" - " ldr r2, [r0], #4 \n" - " str r2, [r1], #4 \n" - " le lr, 2b \n" - "1: \n" - - " add %[pwSource], %[iSourceStride] \n" - " add %[pwTarget], %[iTargetStride] \n" - " subs %[iHeight], #1 \n" - " bne 3b \n" - - : [pwTarget] "+r"(pwTarget), [pwSource] "+r"(pwSource) - : [iHeight] "r"(ptCopySize->iHeight), [iWidth] "r" (ptCopySize->iWidth/2), - [iWidthTail] "r" (ptCopySize->iWidth & 1), - [iSourceStride] "r" (iSourceStride*sizeof(uint32_t)), - [iTargetStride] "r" (iTargetStride*sizeof(uint32_t)) - : "r0", "r1", "r2", "r3", "q0", "memory", "r14", "cc" - ); - } - else - { - /* - * generic column major 32-bit 2D copy - */ - __asm volatile( - "3: \n" - - " mov r0, %[pwSource] \n" - " mov r1, %[pwTarget] \n" - - " wlstp.32 lr, %[iWidth], 1f \n" - ".p2align 2 \n" - "2: \n" - " vldrw.32 q0, [r0], #16 \n" - " vstrw.32 q0, [r1], #16 \n" - " letp lr, 2b \n" - "1: \n" - " add %[pwSource], %[iSourceStride] \n" - " add %[pwTarget], %[iTargetStride] \n" - " subs %[iHeight], #1 \n" - " bne 3b \n" - - : [pwTarget] "+r"(pwTarget), [pwSource] "+r"(pwSource) - : [iHeight] "r"(ptCopySize->iHeight), [iWidth] "r" (ptCopySize->iWidth), - [iSourceStride] "r" (iSourceStride*sizeof(uint32_t)), - [iTargetStride] "r" (iTargetStride*sizeof(uint32_t)) - : "r0", "r1", "q0", "memory", "r14", "cc"); - } -} - -/*----------------------------------------------------------------------------* - * alpha blending * - *----------------------------------------------------------------------------*/ - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_gray8_alpha_blending)(uint8_t * __RESTRICT pSourceBase, - int16_t iSourceStride, - uint8_t * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint_fast16_t hwRatio) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - uint16_t hwRatioCompl = 256 - hwRatio; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - const uint8_t *pSource = pSourceBase; - uint8_t *pTarget = pTargetBase; - int32_t blkCnt = iWidth; - -#ifdef USE_MVE_INTRINSICS - do { - mve_pred16_t tailPred = vctp16q(blkCnt); - uint16x8_t vecTgt = vldrbq_z_u16(pTarget, tailPred); - uint16x8_t vecSrc = vldrbq_z_u16(pSource, tailPred); - - vecTgt = vmulq_x(vecTgt, hwRatioCompl, tailPred); - vecTgt = vmlaq_m(vecTgt, vecSrc, hwRatio, tailPred); - vecTgt = vecTgt >> 8; - - vstrbq_p_u16(pTarget , vecTgt , tailPred); - - pSource += 8; - pTarget += 8; - blkCnt -= 8; - } - while (blkCnt > 0); - -#else - __asm volatile( - " vldrb.u16 q0, [%[pTarget]] \n" - ".p2align 2 \n" - " wls lr, %[loopCnt], 1f \n" - "2: \n" - " vmul.u16 q0, q0, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pSource]], #8 \n" - " vmla.s16 q0, q1, %[hwRatio] \n" - " vldrb.u16 q2, [%[pTarget], #8] \n" - " vshr.u16 q0, q0, #8 \n" - " vstrb.u16 q0, [%[pTarget]], #8 \n" - " vmul.u16 q2, q2, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pSource]], #8 \n" - " vmla.s16 q2, q1, %[hwRatio] \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vshr.u16 q2, q2, #8 \n" - " vstrb.u16 q2, [%[pTarget]], #8 \n" - " le lr, 2b \n" - "1: \n" - /* tail */ - " wlstp.16 lr, %[tail], 1f \n" - "2: \n" - " vmul.u16 q0, q0, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pSource]], #8 \n" - " vmla.s16 q0, q1, %[hwRatio] \n" - " vshr.u16 q1, q0, #8 \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vstrb.u16 q1, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - : [pTarget] "+r"(pTarget), [pSource] "+r" (pSource) - : [hwRatio] "r" (hwRatio), [hwRatioCompl] "r" (hwRatioCompl), - [loopCnt] "r"(blkCnt/16), [tail] "r"(blkCnt & 0xf) - :"q0", "q1", "q2", "memory", "r14"); -#endif - pSourceBase += (iSourceStride); - pTargetBase += (iTargetStride); - } -} - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_gray8_alpha_blending_colour_keying)(uint8_t * __RESTRICT pSourceBase, - int16_t iSourceStride, - uint8_t * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __RESTRICT ptCopySize, - uint_fast16_t hwRatio, - uint8_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - uint16_t hwRatioCompl = 256 - hwRatio; - - for (int_fast16_t y = 0; y < iHeight; y++) { - - const uint8_t *pSource = pSourceBase; - uint8_t *pTarget = pTargetBase; - int32_t blkCnt = iWidth; - -#ifdef USE_MVE_INTRINSICS - do { - mve_pred16_t tailPred = vctp16q(blkCnt); - uint16x8_t vecTgt = vldrbq_z_u16(pTarget, tailPred); - uint16x8_t vecSrc = vldrbq_z_u16(pSource, tailPred); - - vecTgt = vmulq_x(vecTgt, hwRatioCompl, tailPred); - vecTgt = vmlaq_m(vecTgt, vecSrc, hwRatio, tailPred); - vecTgt = vecTgt >> 8; - - vstrbq_p_u16(pTarget , vecTgt , - vcmpneq_m_n_u16(vecSrc, (uint16_t)Colour, tailPred)); - - pSource += 8; - pTarget += 8; - blkCnt -= 8; - } - while (blkCnt > 0); - -#else - __asm volatile( - " vldrb.u16 q0, [%[pTarget]] \n" - ".p2align 2 \n" - " wls lr, %[loopCnt], 1f \n" - "2: \n" - " vmul.u16 q0, q0, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pSource]], #8 \n" - " vmla.s16 q0, q1, %[hwRatio] \n" - " vldrb.u16 q2, [%[pTarget], #8] \n" - " vshr.u16 q0, q0, #8 \n" - " vpt.u16 ne, q1, %[Colour] \n" - " vstrbt.u16 q0, [%[pTarget]], #8 \n" - " vmul.u16 q2, q2, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pSource]], #8 \n" - " vmla.s16 q2, q1, %[hwRatio] \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vshr.u16 q2, q2, #8 \n" - " vpt.u16 ne, q1, %[Colour] \n" - " vstrbt.u16 q2, [%[pTarget]], #8 \n" - " le lr, 2b \n" - "1: \n" - /* tail */ - " wlstp.16 lr, %[tail], 1f \n" - "2: \n" - " vmul.u16 q0, q0, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pSource]], #8 \n" - " vmla.s16 q0, q1, %[hwRatio] \n" - " vshr.u16 q2, q0, #8 \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vpt.u16 ne, q1, %[Colour] \n" - " vstrbt.u16 q2, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - : [pTarget] "+r"(pTarget), [pSource] "+r" (pSource) - : [hwRatio] "r" (hwRatio), [hwRatioCompl] "r" (hwRatioCompl), - [loopCnt] "r"(blkCnt/16), [tail] "r"(blkCnt & 0xf), - [Colour] "r" (Colour) - :"q0", "q1", "q2", "memory", "r14"); -#endif - pSourceBase += (iSourceStride); - pTargetBase += (iTargetStride); - } -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_gray8_colour_filling_with_opacity)(uint8_t * __restrict pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __restrict ptCopySize, - uint8_t Colour, - uint_fast16_t hwRatio) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - - uint16_t hwRatioCompl = 256 - hwRatio; - - uint16x8_t vecSrc = vdupq_n_u16(Colour); - - for (int_fast16_t y = 0; y < iHeight; y++) { - - uint8_t *pTarget = pTargetBase; - int32_t blkCnt = iWidth; - -#ifdef USE_MVE_INTRINSICS - do { - mve_pred16_t tailPred = vctp16q(blkCnt); - uint16x8_t vecTgt = vldrbq_z_u16(pTarget, tailPred); - - vecTgt = vmulq_x(vecTgt, hwRatioCompl, tailPred); - vecTgt = vmlaq_m(vecTgt, vecSrc, hwRatio, tailPred); - vecTgt = vecTgt >> 8; - - vstrbq_p_u16(pTarget , vecTgt , tailPred); - - pTarget += 8; - blkCnt -= 8; - } - while (blkCnt > 0); - -#else - __asm volatile( - " vldrb.u16 q0, [%[pTarget]] \n" - " vmul.u16 q0, q0, %[hwRatioCompl] \n" - ".p2align 2 \n" - " wls lr, %[loopCnt], 1f \n" - "2: \n" - - " vmla.s16 q0, %[vecSrc], %[hwRatio] \n" - " vldrb.u16 q2, [%[pTarget], #8] \n" - " vshr.u16 q0, q0, #8 \n" - " vmul.u16 q2, q2, %[hwRatioCompl] \n" - " vstrb.u16 q0, [%[pTarget]], #8 \n" - " vmla.s16 q2, %[vecSrc], %[hwRatio] \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vshr.u16 q2, q2, #8 \n" - " vmul.u16 q0, q0, %[hwRatioCompl] \n" - " vstrb.u16 q2, [%[pTarget]], #8 \n" - " le lr, 2b \n" - "1: \n" - /* tail */ - " wlstp.16 lr, %[tail], 1f \n" - "2: \n" - - " vmla.s16 q0, %[vecSrc], %[hwRatio] \n" - " vshr.u16 q2, q0, #8 \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vmul.u16 q0, q0, %[hwRatioCompl] \n" - " vstrb.u16 q2, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - : [pTarget] "+r"(pTarget) - : [hwRatio] "r" (hwRatio), [hwRatioCompl] "r" (hwRatioCompl), - [loopCnt] "r"(blkCnt/16), [tail] "r"(blkCnt & 0xf), - [vecSrc] "t" (vecSrc) - :"q0", "q2", "memory", "r14"); -#endif - pTargetBase += (iTargetStride); - } -} - - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_alpha_blending)( uint16_t *phwSourceBase, - int16_t iSourceStride, - uint16_t *phwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *ptCopySize, - uint_fast16_t hwRatio) -{ -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt; - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecMaskGpck = vdupq_n_u16(0x00fc); - - - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - const uint16_t *phwSource = phwSourceBase; - uint16_t *phwTarget = phwTargetBase; - - blkCnt = ptCopySize->iWidth; - do { - - uint16x8_t vecIn; - uint16x8_t vecR0, vecB0, vecG0; - uint16x8_t vecR1, vecB1, vecG1; - - /* unpack 1st stream */ - vecIn = vld1q(phwSource); - vecR0 = vecIn & vecMaskR; - - vecB0 = vecIn >> 11; - - vecG0 = vecIn >> 5; - vecG0 = vecG0 & vecMaskG; - - - /* unpack 2nd stream */ - vecIn = vld1q(phwTarget); - vecR1 = vecIn & vecMaskR; - - vecB1 = vecIn >> 11; - - vecG1 = vecIn >> 5; - vecG1 = vecG1 & vecMaskG; - - - /* merge */ - vecR0 = vecR0 * ratio1x8 + vecR1 * ratio2x8; - vecR0 = vecR0 >> 8; - - vecG0 = vecG0 * ratio1x4 + vecG1 * ratio2x4; - vecG0 = vecG0 >> 8; - - vecB0 = vecB0 * ratio1x8 + vecB1 * ratio2x8; - vecB0 = vecB0 >> 8; - - - /* pack */ - uint16x8_t vOut = vecR0 >> 3 | vmulq((vecG0 & vecMaskGpck), 8) - | vmulq((vecB0 & vecMaskBpck), 256); - - - vst1q(phwTarget, vOut); - - phwSource += 8; - phwTarget += 8; - blkCnt -= 8; - } - while (blkCnt > 0); - - phwSourceBase += iSourceStride; - phwTargetBase += iTargetStride; - } - -#else /* USE_MVE_INTRINSICS */ - - - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint32_t iWidth = ptCopySize->iWidth; - int32_t row = ptCopySize->iHeight; - uint16x8_t scratch[1]; - - vst1q((uint16_t *)scratch, vdupq_n_u16(0x00fc)); - - do { - const uint16_t *pSource = phwSourceBase; - uint16_t *pTarget = phwTargetBase; - register unsigned loopCnt __asm("lr"); - loopCnt = iWidth; - - __asm volatile( - ".p2align 2 \n" - " vldrh.u16 q4, [%[pTarget]] \n" - " vldrh.u16 q5, [%[pSource]], #16 \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - // B target extraction - // right shift by 5 (x 1/32) for M55 friendly - // IV / Mul pipe interleaving - " vqdmulh.s16 q2, q4, %[rshft5] \n" - " vand q7, q4, %[vecMaskR] \n" - - " vmul.i16 q6, q7, %[ratio2x8] \n" - // B source extraction - " vand q7, q5, %[vecMaskR] \n" - // B mix - " vmla.s16 q6, q7, %[ratio1x8] \n" - // G extraction - " vand q2, q2, %[vecMaskG] \n" - " vshr.u16 q7, q5, #5 \n" - " vmul.i16 q2, q2, %[ratio2x4] \n" - // G extraction - " vand q7, q7, %[vecMaskG] \n" - // G mix - " vmla.s16 q2, q7, %[ratio1x4] \n" - // R extraction - " vshr.u16 q4, q4, #11 \n" - " vmul.i16 q7, q4, %[ratio2x8] \n" - // R extraction - " vshr.u16 q5, q5, #11 \n" - // R mix - " vmla.s16 q7, q5, %[ratio1x8] \n" - - " vshr.u16 q2, q2, #8 \n" - " vldrh.16 q5, [%[scratch]] \n" - - " vand q2, q2, q5 \n" - // vmulq((vecG0 & 0x00fc), 8) - " vmul.i16 q2, q2, %[eight] \n" - " vshr.u16 q4, q7, #8 \n" - // schedule next source load - " vldrh.u16 q5, [%[pSource]], #16 \n" - " vand q7, q4, %[vecMaskBpck] \n" - // pack R & G - // vmulq((vecG0 & vecMaskGpck), 8) + vmulq((vecR0 & vecMaskRpck), 256) - " vmla.s16 q2, q7, %[twofiftysix] \n" - // downshift B ((vecB0 >> 8) >> 3) - " vshr.u16 q7, q6, #11 \n" - // schedule next target load (pre offset as target not imcrementred so far) - " vldrh.u16 q4, [%[pTarget], #16] \n" - // pack blue with R&G - " vorr q2, q2, q7 \n" - - " vstrh.16 q2, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - - : [pSource] "+r"(pSource), [pTarget] "+r" (pTarget), [loopCnt] "+r"(loopCnt) - : [vecMaskR] "t" (vecMaskR), [vecMaskG] "t" (vecMaskG), - [vecMaskBpck] "t" (vecMaskBpck), - [ratio1x8] "r" (ratio1x8), [ratio2x8] "r" (ratio2x8), - [ratio1x4] "r" (ratio1x4), [ratio2x4] "r" (ratio2x4), - [eight] "r" (8), [twofiftysix] "r" (256), [rshft5] "r" (1024), [scratch] "r" (scratch) - : "q2", "q4", "q5", "q6", "q7", "memory" ); - - phwSourceBase += iSourceStride; - phwTargetBase += iTargetStride; - } while (--row); -#endif /* USE_MVE_INTRINSICS */ -} - - - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_colour_filling_with_opacity)( - uint16_t *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint16_t Colour, - uint_fast16_t hwRatio) -{ - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt; - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecMaskGpck = vdupq_n_u16(0x00fc); - uint16x8_t vecIn; - uint16x8_t vecColorR, vecColorB, vecColorG; - - /* unpack color & scale */ - vecIn = vdupq_n_u16(Colour); - vecColorR = (vecIn & vecMaskR) * ratio1x8; - - vecColorB = (vecIn >> 11) * ratio1x8; - - vecColorG = vecIn >> 5; - vecColorG = (vecColorG & vecMaskG) * ratio1x4; - - for (int32_t y = 0; y < ptCopySize->iHeight; y++) { - uint16_t *phwTarget = pTargetBase; - - blkCnt = ptCopySize->iWidth; - do { - uint16x8_t vecR0, vecB0, vecG0; - uint16x8_t vecR1, vecB1, vecG1; - - /* unpack stream */ - vecIn = vld1q(phwTarget); - vecR1 = vecIn & vecMaskR; - - vecB1 = vecIn >> 11; - - vecG1 = vecIn >> 5; - vecG1 = vecG1 & vecMaskG; - - - /* merge */ - vecR0 = vecColorR + vecR1 * ratio2x8; - vecR0 = vecR0 >> 8; - - vecG0 = vecColorG + vecG1 * ratio2x4; - vecG0 = vecG0 >> 8; - - vecB0 = vecColorB + vecB1 * ratio2x8; - vecB0 = vecB0 >> 8; - - /* pack */ - uint16x8_t vOut = vecR0 >> 3 | vmulq((vecG0 & vecMaskGpck), 8) - | vmulq((vecB0 & vecMaskBpck), 256); - - vst1q(phwTarget, vOut); - - phwTarget += 8; - blkCnt -= 8; - } - while (blkCnt > 0); - - pTargetBase += iTargetStride; - } - -#else /* USE_MVE_INTRINSICS */ - - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecColorR, vecColorB, vecColorG; - uint16x8_t scratch[4]; - - /* unpack color */ - uint16x8_t vecIn = vdupq_n_u16(Colour); - vecColorR = vecIn & vecMaskR; - vecColorB = vecIn >> 11; - vecColorG = vecIn >> 5; - vecColorG = vecColorG & vecMaskG; - vst1q((uint16_t*)scratch, vecColorR * ratio1x8); - vst1q((uint16_t*)&scratch[1], vecColorB * ratio1x8); - vst1q((uint16_t*)&scratch[2], vecColorG * ratio1x4); - vst1q((uint16_t*)&scratch[3], vdupq_n_u16(0x00fc)); - - int32_t row = ptCopySize->iHeight; - do { - - uint16_t *phwTarget = pTargetBase; - register unsigned loopCnt __asm("lr"); - loopCnt = ptCopySize->iWidth; - - __asm volatile( - " vldrh.u16 q4, [%[phwTarget]] \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - ".p2align 2 \n" - "2: \n" - // B target extraction - " vand q7, q4, %[vecMaskR] \n" - " vldrh.u16 q6, [%[scratch]] \n" - " vshr.u16 q2, q4, #5 \n" - - // B mix - " vmla.s16 q6, q7, %[ratio2x8] \n" - // G extraction - " vand q7, q2, %[vecMaskG] \n" - - // G extraction - " vldrh.u16 q2, [%[scratch], #32] \n" - // G mix - " vmla.s16 q2, q7, %[ratio2x4] \n" - - " vshr.u16 q4, q4, #11 \n" - // R extraction - " vldrh.u16 q7, [%[scratch], #16] \n" - " vshr.u16 q2, q2, #8 \n" - // R mix - " vmla.s16 q7, q4, %[ratio2x8] \n" - " vshr.u16 q4, q7, #8 \n" - - // load duplicated 0xfc mask - " vldrh.u16 q7, [%[scratch], #48] \n" - " vand q2, q2, q7 \n" - - " vmul.i16 q2, q2, %[eight] \n" - " vand q7, q4, %[vecMaskBpck] \n" - - // pack R & G - " vmla.s16 q2, q7, %[twofiftysix] \n" - // downshift B ((vecB0 >> 8) >> 3) - " vshr.u16 q7, q6, #11 \n" - // schedule next target load - " vldrh.u16 q4, [%[phwTarget], #16] \n" - // pack blue with R&G - " vorr q2, q2, q7 \n" - " vstrh.16 q2, [%[phwTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - : [phwTarget] "+r" (phwTarget), [loopCnt] "+r"(loopCnt) - : [vecMaskR] "t" (vecMaskR), [vecMaskG] "t" (vecMaskG), - [vecMaskBpck] "t" (vecMaskBpck), - [ratio2x8] "r" (ratio2x8), [ratio2x4] "r" (ratio2x4), - [eight] "r" (8), [twofiftysix] "r" (256), [scratch] "r" (scratch) - : "q2", "q4", "q5", "q6", "q7", "memory" ); - - pTargetBase += iTargetStride; - } while (--row); - -#endif /* USE_MVE_INTRINSICS */ - -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_alpha_blending_colour_keying)( - uint16_t * __RESTRICT phwSource, - int16_t iSourceStride, - uint16_t * __RESTRICT phwTarget, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint_fast16_t hwRatio, - uint16_t hwColour) -{ -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - -#ifdef USE_MVE_INTRINSICS - uint32_t iHeight = ptCopySize->iHeight; - uint32_t iWidth = ptCopySize->iWidth; - - int32_t blkCnt; - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecMaskGpck = vdupq_n_u16(0x00fc); - - for (uint32_t y = 0; y < iHeight; y++) { - // - inconditional blending + predicated dst update - const uint16_t *pSource = phwSource; - uint16_t *pTarget = phwTarget; - blkCnt = iWidth >> 3; - - while (blkCnt > 0) { - uint16x8_t vecInSrc, vecInDst; - uint16x8_t vecR0, vecB0, vecG0; - uint16x8_t vecR1, vecB1, vecG1; - - /* unpack 1st stream */ - vecInSrc = vld1q(pSource); - vecR0 = vandq(vecInSrc, vecMaskR); - vecB0 = vshrq(vecInSrc, 11); - vecG0 = vshrq(vecInSrc, 5); - vecG0 = vandq(vecG0, vecMaskG); - - /* unpack 2nd stream */ - vecInDst = vld1q(pTarget); - vecR1 = vandq(vecInDst, vecMaskR); - vecB1 = vshrq(vecInDst, 11); - vecG1 = vshrq(vecInDst, 5); - vecG1 = vandq(vecG1, vecMaskG); - - /* merge */ - vecR0 = vmlaq(vmulq(vecR0, ratio1x8), vecR1, ratio2x8); - vecR0 = vshrq(vecR0, 8); - vecG0 = vmlaq(vmulq(vecG0, ratio1x4), vecG1, ratio2x4); - vecG0 = vshrq(vecG0, 8); - vecB0 = vmlaq(vmulq(vecB0, ratio1x8), vecB1, ratio2x8); - vecB0 = vshrq(vecB0, 8); - - /* pack */ - uint16x8_t vOut = vorrq(vshrq(vecR0, 3), - vmulq(vandq(vecG0, vecMaskGpck), 8)); - - vOut = vorrq(vOut, vmulq(vandq(vecB0, vecMaskBpck), 256)); - - vst1q_p(pTarget, vOut, vcmpneq_n_s16(vecInSrc, hwColour)); - - pSource += 8; - pTarget += 8; - blkCnt--; - - } - - blkCnt = iWidth & 7; - if (blkCnt > 0U) { - uint16x8_t vecInSrc, vecInDst; - uint16x8_t vecR0, vecB0, vecG0; - uint16x8_t vecR1, vecB1, vecG1; - - /* unpack 1st stream */ - vecInSrc = vld1q(pSource); - vecR0 = vandq(vecInSrc, vecMaskR); - vecB0 = vshrq(vecInSrc, 11); - vecG0 = vshrq(vecInSrc, 5); - vecG0 = vandq(vecG0, vecMaskG); - - /* unpack 2nd stream */ - vecInDst = vld1q(pTarget); - vecR1 = vandq(vecInDst, vecMaskR); - vecB1 = vshrq(vecInDst, 11); - vecG1 = vshrq(vecInDst, 5); - vecG1 = vandq(vecG1, vecMaskG); - - /* merge */ - vecR0 = vmlaq(vmulq(vecR0, ratio1x8), vecR1, ratio2x8); - vecR0 = vshrq(vecR0, 8); - vecG0 = vmlaq(vmulq(vecG0, ratio1x4), vecG1, ratio2x4); - vecG0 = vshrq(vecG0, 8); - vecB0 = vmlaq(vmulq(vecB0, ratio1x8), vecB1, ratio2x8); - vecB0 = vshrq(vecB0, 8); - - /* pack */ - uint16x8_t vOut = vorrq(vshrq(vecR0, 3), - vmulq(vandq(vecG0, vecMaskGpck), 8)); - - vOut = vorrq(vOut, - vmulq(vandq(vecB0, vecMaskBpck), 256)); - - vst1q_p(pTarget, vOut, - vcmpneq_m_n_s16(vecInSrc, hwColour, vctp16q(blkCnt))); - - } - - phwSource += iSourceStride; - phwTarget += iTargetStride; - } -#else - uint32_t iHeight = ptCopySize->iHeight; - uint32_t iWidth = ptCopySize->iWidth; - - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t scratch[1]; - - vst1q((uint16_t *)scratch, vdupq_n_u16(0x00fc)); - - for (uint32_t y = 0; y < iHeight; y++) { - - const uint16_t *pSource = phwSource; - uint16_t *pTarget = phwTarget; - register unsigned loopCnt __asm("lr"); - loopCnt = iWidth; - - __asm volatile( - ".p2align 2 \n" - " vldrh.u16 q4, [%[pTarget]] \n" - " vldrh.u16 q5, [%[pSource]], #16 \n" - " vand q7, q4, %[vecMaskR] \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - // B target extraction - " vshr.u16 q2, q4, #5 \n" - " vmul.i16 q6, q7, %[ratio2x8] \n" - // B source extraction - " vand q7, q5, %[vecMaskR] \n" - // B mix - " vmla.s16 q6, q7, %[ratio1x8] \n" - // G extraction - " vand q2, q2, %[vecMaskG] \n" - " vshr.u16 q7, q5, #5 \n" - " vmul.i16 q2, q2, %[ratio2x4] \n" - // G extraction - " vand q7, q7, %[vecMaskG] \n" - // G mix - " vmla.s16 q2, q7, %[ratio1x4] \n" - // R extraction - " vshr.u16 q4, q4, #11 \n" - " vmul.i16 q7, q4, %[ratio2x8] \n" - // R extraction - " vshr.u16 q5, q5, #11 \n" - // R mix - " vmla.s16 q7, q5, %[ratio1x8] \n" - - " vshr.u16 q2, q2, #8 \n" - " vldrh.16 q5, [%[scratch]] \n" - - " vand q2, q2, q5 \n" - // vmulq((vecG0 & 0x00fc), 8) - " vmul.i16 q2, q2, %[eight] \n" - " vshr.u16 q4, q7, #8 \n" - // schedule next source load - " vldrh.u16 q5, [%[pSource]], #16 \n" - " vand q7, q4, %[vecMaskBpck] \n" - // pack R & G - // vmulq((vecG0 & vecMaskGpck), 8) + vmulq((vecR0 & vecMaskRpck), 256) - " vmla.s16 q2, q7, %[twofiftysix] \n" - // downshift B ((vecB0 >> 8) >> 3) - " vshr.u16 q7, q6, #11 \n" - // schedule next target load (pre offset as target not imcrementred so far) - " vldrh.u16 q4, [%[pTarget], #16] \n" - // pack blue with R&G - " vorr q2, q2, q7 \n" - " vldrh.u16 q6, [%[pSource], #-32] \n" - " vand q7, q4, %[vecMaskR] \n" - " vpt.u16 ne, q6, %[hwColour] \n" - " vstrht.16 q2, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - - : [pSource] "+r"(pSource), [pTarget] "+r" (pTarget), [loopCnt] "+r"(loopCnt) - : [vecMaskR] "t" (vecMaskR), [vecMaskG] "t" (vecMaskG), - [vecMaskBpck] "t" (vecMaskBpck), - [ratio1x8] "r" (ratio1x8), [ratio2x8] "r" (ratio2x8), - [ratio1x4] "r" (ratio1x4), [ratio2x4] "r" (ratio2x4), - [eight] "r" (8), [twofiftysix] "r" (256), [hwColour] "r" (hwColour), [scratch] "r" (scratch) - : "q2", "q4", "q5", "q6", "q7", "memory" ); - - phwSource += (iSourceStride); - phwTarget += (iTargetStride); - } -#endif -} - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_alpha_blending)( uint32_t *pwSourceBase, - int16_t iSourceStride, - uint32_t *pwTargetBase, - int16_t iTargetStride, - arm_2d_size_t *ptCopySize, - uint_fast16_t hwRatio) -{ -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - uint16_t hwRatioCompl = 256 - (uint16_t) hwRatio; - -#ifdef USE_MVE_INTRINSICS - - - int32_t blkCnt; - int32_t row = ptCopySize->iHeight; - - while (row > 0) { - - const uint32_t *pwSource = pwSourceBase; - uint32_t *pwTarget = pwTargetBase; - /* byte extraction into 16-bit vector */ - uint16x8_t vecSrc = vldrbq_u16((const uint8_t *)pwSource); - uint16x8_t vecTrg = vldrbq_u16((const uint8_t *)pwTarget); - - pwSource += 2; - blkCnt = ptCopySize->iWidth; - - while (blkCnt > 0) { - vstrbq_u16((const uint8_t *)pwTarget, - vmlaq(vmulq(vecSrc, hwRatio), vecTrg, hwRatioCompl) >> 8); - - pwTarget += 2; - - vecSrc = vldrbq_u16((const uint8_t *)pwSource); - vecTrg = vldrbq_u16((const uint8_t *)pwTarget); - pwSource += 2; - blkCnt -= 2; - } - - pwSourceBase += iSourceStride; - pwTargetBase += iTargetStride; - row--; - } -#else - - register unsigned blkCnt __asm("lr"); - int32_t row = ptCopySize->iHeight; - - while(row > 0) - { - blkCnt = ptCopySize->iWidth*4; - const uint32_t *pwSource = pwSourceBase; - uint32_t *pwTarget = pwTargetBase; - - __asm volatile( - " vldrb.u16 q0, [%[pwSource]], #8 \n" - " vldrb.u16 q1, [%[pwTarget]] \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - " vmul.u16 q2, q0, %[hwRatio] \n" - " vldrb.u16 q0, [%[pwSource]], #8 \n" - " vmla.s16 q2, q1, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pwTarget], #8] \n" - " vshr.u16 q2, q2, #8 \n" - " vstrb.16 q2, [%[pwTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - : [pwSource] "+l"(pwSource), [pwTarget] "+l"(pwTarget), - [loopCnt] "+r"(blkCnt) - : [hwRatio] "r" (hwRatio), [hwRatioCompl] "r" (hwRatioCompl) - : "q0", "q1", "q2", "memory" ); - - pwSourceBase += iSourceStride; - pwTargetBase += iTargetStride; - row--; - } -#endif -} - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_colour_filling_with_opacity)( - uint32_t *__RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t *__RESTRICT ptCopySize, - uint32_t Colour, - uint_fast16_t hwRatio) -{ -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - uint16_t hwRatioCompl = 256 - (uint16_t) hwRatio; - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt; - int32_t row = ptCopySize->iHeight; - uint32_t scratch[2]; - uint16x8_t vColor; - - scratch[0] = scratch[1] = Colour; - vColor = vldrbq_u16((uint8_t *) scratch); - vColor = vColor * (uint16_t)hwRatio; - - while (row > 0) { - uint32_t *pTarget = pTargetBase; - blkCnt = ptCopySize->iWidth; - - while (blkCnt > 0) { - /* byte extraction into 16-bit vector */ - uint16x8_t vecTrg = vldrbq_u16((uint8_t *)pTarget); - - vstrbq_u16((uint8_t *)pTarget, vmlaq(vColor, vecTrg, hwRatioCompl) >> 8); - - pTarget += 2; - blkCnt -= 2; - } - pTargetBase += iTargetStride; - row--; - } -#else /* USE_MVE_INTRINSICS */ - - int32_t blkCnt; - int32_t row = ptCopySize->iHeight; - uint32_t scratch[2]; - uint16x8_t vColor; - - scratch[0] = scratch[1] = Colour; - vColor = vldrbq_u16((uint8_t *) scratch); - vColor = vColor * (uint16_t)hwRatio; - - while (row > 0) { - uint32_t *pTarget = pTargetBase; - blkCnt = ptCopySize->iWidth*4; - - __asm volatile( - /* preload */ - " vldrb.u16 q1, [%[pTarget]] \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - ".p2align 2 \n" - "2: \n" - " vmov q2, %[vColor] \n" - " vmla.s16 q2, q1, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pTarget], #8] \n" - " vshr.u16 q2, q2, #8 \n" - " vstrb.16 q2, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - : [pTarget] "+l"(pTarget) - : [loopCnt] "r"(blkCnt), [hwRatioCompl] "r" (hwRatioCompl), [vColor] "t" (vColor) - : "q0", "q1", "q2", "memory" ); - - pTargetBase += iTargetStride; - row--; - } - -#endif /* USE_MVE_INTRINSICS */ -} - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_alpha_blending_colour_keying)(uint32_t * __RESTRICT pSourceBase, - int16_t iSourceStride, - uint32_t * __RESTRICT pTargetBase, - int16_t iTargetStride, - arm_2d_size_t * - __RESTRICT ptCopySize, - uint_fast16_t hwRatio, - uint32_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - uint16_t hwRatioCompl = 256 - hwRatio; - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint32_t *pSource = pSourceBase; - uint32_t *pTarget = pTargetBase; - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt = iWidth; - - do { - mve_pred16_t p = vctp32q(blkCnt); - - uint8x16_t vSrc8 = vld1q_z(pSource, p); - uint8x16_t vTrg8 = vld1q_z(pTarget, p); - - /* 16-bit expansion A/G src pixels */ - uint16x8_t vSrc16b = vmovlbq_x(vSrc8, p); - /* 16-bit expansion R/B src pixels */ - uint16x8_t vSrc16t = vmovltq_x(vSrc8, p); - - /* 16-bit expansion A/G target pixels */ - uint16x8_t vTrg16b = vmovlbq_x(vTrg8, p); - /* 16-bit expansion R/B target pixels */ - uint16x8_t vTrg16t = vmovltq_x(vTrg8, p); - - /* A/G blending */ - int16x8_t vecOutb = vmlaq_m(vmulq_x(vSrc16b, hwRatio, p), vTrg16b, hwRatioCompl, p); - /* R/B blending */ - int16x8_t vecOutt = vmlaq_m(vmulq_x(vSrc16t, hwRatio, p), vTrg16t, hwRatioCompl, p); - - /* merge into 8-bit vector */ - int8x16_t vecOut8 = vuninitializedq_s8(); - - vecOut8 = vqshrnbq_m_n_s16(vecOut8, vecOutb, 8, p); - vecOut8 = vqshrntq_m_n_s16(vecOut8, vecOutt, 8, p); - - // update if (*pSourceBase != Colour) - vst1q_p_u32(pTarget, (uint32x4_t) vecOut8, - vcmpneq_m_n_u32((uint32x4_t) vSrc8, Colour, p)); - - pSource += 4; - pTarget += 4; - blkCnt -= 4; - } - while (blkCnt > 0); - -#else // USE_MVE_INTRINSICS - - __asm volatile ( - ".p2align 2 \n" - /* preload uint32x4_t target vector */ - " vldrw.u32 q2, [%[targ]] \n" - - " wlstp.32 lr, %[loopCnt], 1f \n" - "2: \n" - /* 16-bit expansion A/G target pixels */ - " vmovlb.u8 q3, q2 \n" - " vldrw.u32 q0, [%[src]], #16 \n" - /* 16-bit expansion A/G source pixels */ - " vmovlb.u8 q1, q0 \n" - " vmul.i16 q1, q1, %[ratio] \n" - /* 16-bit expansion R/B target pixels */ - " vmovlt.u8 q2, q2 \n" - /* A/G blending */ - " vmla.s16 q1, q3, %[ratioCmp] \n" - /* 16-bit expansion R/B source pixels */ - " vmovlt.u8 q3, q0 \n" - " vmul.i16 q3, q3, %[ratio] \n" - /* merge A/G into 8-bit vector */ - " vqshrnb.s16 q1, q1, #8 \n" - /* R/B blending */ - " vmla.s16 q3, q2, %[ratioCmp] \n" - /* preload next target */ - " vldrw.u32 q2, [%[targ], #16] \n" - /* merge R/B into 8-bit vector */ - " vqshrnt.s16 q1, q3, #8 \n" - /* update if (*pSourceBase != Colour) */ - " vpt.i32 ne, q0, %[color] \n" - " vstrwt.32 q1, [%[targ]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[targ] "+r" (pTarget), [src] "+r" (pSource) - :[loopCnt] "r" (iWidth), [ratio] "r" (hwRatio), - [ratioCmp] "r" (hwRatioCompl), [color] "r" (Colour) - :"r14", "q0", "q1", "q2", "q3", "memory"); -#endif - pSourceBase += (iSourceStride); - pTargetBase += (iTargetStride); - } -} - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_alpha_blending_direct)(const uint16_t *phwSource, - const uint16_t *phwBackground, - uint16_t *phwDestination, - uint32_t wPixelCount, - uint_fast16_t hwRatio) -{ -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt; - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - uint16x8_t vecMaskGpck = vdupq_n_u16(0x00fc); - - blkCnt = wPixelCount; - do { - - uint16x8_t vecIn; - uint16x8_t vecR0, vecB0, vecG0; - uint16x8_t vecR1, vecB1, vecG1; - - /* unpack 1st stream */ - vecIn = vld1q(phwSource); - phwSource += 8; - - vecR0 = vecIn & vecMaskR; - - vecB0 = vecIn >> 11; - - vecG0 = vecIn >> 5; - vecG0 = vecG0 & vecMaskG; - - - /* unpack 2nd stream */ - vecIn = vld1q(phwBackground); - phwBackground += 8; - - vecR1 = vecIn & vecMaskR; - - vecB1 = vecIn >> 11; - - vecG1 = vecIn >> 5; - vecG1 = vecG1 & vecMaskG; - - - /* merge */ - vecR0 = vecR0 * ratio1x8 + vecR1 * ratio2x8; - vecR0 = vecR0 >> 8; - - vecG0 = vecG0 * ratio1x4 + vecG1 * ratio2x4; - vecG0 = vecG0 >> 8; - - vecB0 = vecB0 * ratio1x8 + vecB1 * ratio2x8; - vecB0 = vecB0 >> 8; - - - /* pack */ - uint16x8_t vOut = - vecR0 >> 3 | vmulq((vecG0 & vecMaskGpck), 8) - | vmulq((vecB0 & vecMaskBpck), 256); - - vst1q(phwDestination, vOut); - phwDestination += 8; - - blkCnt -= 8; - } - while (blkCnt > 0); - -#else /* USE_MVE_INTRINSICS */ - - uint16_t ratio1x8 = hwRatio * 8; - uint16_t ratio1x4 = hwRatio * 4; - uint16_t ratio2x8 = (256 - hwRatio) * 8; - uint16_t ratio2x4 = (256 - hwRatio) * 4; - uint16x8_t vecMaskR = vdupq_n_u16(0x001f); - uint16x8_t vecMaskG = vdupq_n_u16(0x003f); - uint16x8_t vecMaskBpck = vdupq_n_u16(0x00f8); - - register unsigned loopCnt __asm("lr") = (wPixelCount); - - __asm volatile( - - " vldrh.u16 q4, [%[in2]], #16 \n" - " vmov.i16 q6, #0x00fc \n" - " vstrw.32 q6, [sp] \n" - " vldrh.u16 q5, [%[in1]], #16 \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - - " vand q6, q4, %[vecMaskR] \n" - " vmul.i16 q6, q6, %[ratio2x8] \n" - " vshr.u16 q2, q4, #5 \n" - " vand q7, q5, %[vecMaskR] \n" - " vmla.s16 q6, q7, %[ratio1x8] \n" - " vand q2, q2, %[vecMaskG] \n" - " vshr.u16 q7, q5, #5 \n" - " vmul.i16 q2, q2, %[ratio2x4] \n" - " vand q7, q7, %[vecMaskG] \n" - " vmla.s16 q2, q7, %[ratio1x4] \n" - " vshr.u16 q4, q4, #11 \n" - " vmul.i16 q7, q4, %[ratio2x8] \n" - " vshr.u16 q5, q5, #11 \n" - " vshr.u16 q2, q2, #8 \n" - " vmla.s16 q7, q5, %[ratio1x8] \n" - - // " vmov.i16 q6, #0x00fc \n" - " vshr.u16 q7, q7, #8 \n" - // " vmov.i16 q6, #0x00fc \n" - /* load 0x00fc instead of mov for better overlap opportunity */ - " vldrw.u32 q4, [sp] \n" - " vand q2, q2, q4 \n" - " vmul.i16 q2, q2, %[eight] \n" - " vand q4, q7, %[vecMaskBpck] \n" // Q7 = vecB0 - " vldrh.u16 q5, [%[in1]], #16 \n" - " vmla.s16 q2, q4, %[twofiftysix] \n" - // (vecR0 >> 3) >> 8 - " vshr.u16 q6, q6, #11 \n" - " vldrh.u16 q4, [%[in2]], #16 \n" - " vorr q2, q2, q6 \n" - " vstrh.16 q2, [%[out]], #16 \n" - " letp lr, 2b \n" - "1: \n" - - : [in1] "+r"(phwSource), [in2] "+r"(phwBackground), - [out] "+r" (phwDestination), [loopCnt] "+r"(loopCnt) - : [vecMaskR] "t" (vecMaskR), [vecMaskG] "t" (vecMaskG), - [vecMaskBpck] "t" (vecMaskBpck), - [ratio1x8] "r" (ratio1x8), [ratio2x8] "r" (ratio2x8), - [ratio1x4] "r" (ratio1x4), [ratio2x4] "r" (ratio2x4), - [eight] "r" (8), [twofiftysix] "r" (256) - : "q2", "q4", "q5", "q6", "q7", "memory" ); - -#endif -} - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_alpha_blending_direct)(const uint32_t *pwSource, - const uint32_t *pwBackground, - uint32_t *pwDestination, - uint32_t wPixelCount, - uint_fast16_t hwRatio) -{ -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - hwRatio += (hwRatio == 255); -#endif - uint16_t hwRatioCompl = 256 - hwRatio; - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt; - - uint16x8_t vecSrc, vecBckg; - - - vecSrc = vldrbq_u16((uint8_t const *) pwSource); - pwSource += 2; - vecBckg = vldrbq_u16((uint8_t const *) pwBackground); - pwBackground += 2; - - - blkCnt = wPixelCount; - do { - uint16x8_t vecOut; - - vecOut = vmulq_n_u16(vecSrc, (uint16_t) hwRatio); - vecSrc = vldrbq_u16((uint8_t const *) pwSource); - pwSource += 2; - - vecOut = vmlaq_n_u16(vecOut, vecBckg, hwRatioCompl); - vecBckg = vldrbq_u16((uint8_t const *) pwBackground); - pwBackground += 2; - - vecOut = vecOut >> 8; - - vstrbq_u16((uint8_t *) pwDestination, vecOut); - pwDestination += 2; - - blkCnt -= 2; - } - while (blkCnt > 0); - -#else /* USE_MVE_INTRINSICS */ - register unsigned blkCnt __asm("lr") = (wPixelCount * 4); - - __asm volatile( - " vldrb.u16 q0, [%[pwSource]], #8 \n" - " vldrb.u16 q1, [%[pwBackg]], #8 \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - " vmul.u16 q2, q0, %[hwRatio] \n" - " vldrb.u16 q0, [%[pwSource]], #8 \n" - " vmla.s16 q2, q1, %[hwRatioCompl] \n" - " vldrb.u16 q1, [%[pwBackg]], #8 \n" - " vshr.u16 q2, q2, #8 \n" - " vstrb.16 q2, [%[pwDest]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - : [pwSource] "+l"(pwSource), [pwBackg] "+l"(pwBackground), - [pwDest] "+l" (pwDestination), [loopCnt] "+r"(blkCnt) - : [hwRatio] "r" (hwRatio), [hwRatioCompl] "r" (hwRatioCompl) - : "q0", "q1", "q2", "memory" ); -#endif - -} - - - -/* rgb8_draw_pattern helpers */ - -/* - * enable to pick gather load offset based on initial offset - * e.g. if iOffset = 3 - * will get {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2} - */ -static uint8_t __draw_pattern_src_incr_c8bit[32] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3 -}; - -/* - * enable to pick vector bitmask based on initial offset - * e.g. if iOffset = 3 - * will get {8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4} - */ - -static uint8_t __draw_pattern_src_bitmask_c8bit[32] = { - 1, 2, 4, 8, 16, 32, 64, 128, - 1, 2, 4, 8, 16, 32, 64, 128, - 1, 2, 4, 8, 16, 32, 64, 128, - 1, 2, 4, 8, 16, 32, 64, 128, -}; - - -/* rgb16_draw_pattern helpers */ - -/* - * enable to pick gather load offset based on initial offset - * e.g. if iOffset = 3 - * will get {0, 0, 0, 0, 0, 1, 1, 1} - */ -static uint16_t __draw_pattern_src_incr_rgb16[16] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1 -}; - -/* - * enable to pick vector bitmask based on initial offset - * e.g. if iOffset = 3 - * will get {8, 16, 32, 64, 128, 1, 2, 4} - */ - -static uint16_t __draw_pattern_src_bitmask_rgb16[16] = { - 1, 2, 4, 8, 16, 32, 64, 128, - 1, 2, 4, 8, 16, 32, 64, 128, -}; - - -/* rgb32_draw_pattern helpers */ - -static uint32_t __draw_pattern_src_incr_rgb32[16] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1 -}; - - -static uint32_t __draw_pattern_src_bitmask_rgb32[16] = { - 1, 2, 4, 8, 16, 32, 64, 128, - 1, 2, 4, 8, 16, 32, 64, 128, -}; - - - -/*! adding support with c code template */ -#define __API_COLOUR c8bit -#define __API_ELT_SZ 8 -#include "__arm_2d_draw_pattern_helium.inc" - - -#define __API_COLOUR rgb16 -#define __API_ELT_SZ 16 -#include "__arm_2d_draw_pattern_helium.inc" - - -#define __API_COLOUR rgb32 -#define __API_ELT_SZ 32 -#include "__arm_2d_draw_pattern_helium.inc" - - - -#define __API_COLOUR c8bit -#define __API_ELT_SZ 8 -#include "__arm_2d_fill_colour_helium.inc" - - -#define __API_COLOUR rgb16 -#define __API_ELT_SZ 16 -#include "__arm_2d_fill_colour_helium.inc" - - -#define __API_COLOUR rgb32 -#define __API_ELT_SZ 32 -#include "__arm_2d_fill_colour_helium.inc" - - -/** - 8-bit pixel color fill alpha/channel mask with/without opacity MVE intrinsic generator - - TRGT_LOAD is a contigous / strided target load function - C8BIT_TRGT_LOAD / C8BIT_TRGT_LOAD_STRIDE - - STRIDE is an optional vector of offset for gather load - - SCAL_OPACITY is extra alpha scaling function - C8BIT_SCAL_OPACITY_NONE / C8BIT_SCAL_OPACITY - - OPACITY is an optinal 8-bit vector with duplicated opacity values - (need vector format to be used with VMULH.U8) - - ALPHA_SZ, alpha chan width (1 or 4 for resp. 8 or 32-bit type) - - Macro assumes pTarget8/ pAlpha are already setup - */ - - - - -#define C8BIT_COLOUR_FILLING_MASK_INNER_MVE(TRGT_LOAD, STRIDE, SCAL_OPACITY, \ - OPACITY, ALPHA_SZ, COMPVAL) \ - int32_t blkCnt = iWidth; \ - do { \ - mve_pred16_t tailPred = vctp16q(blkCnt); \ - \ - uint16x8_t vecTarget = vldrbq_z_u16(pTarget8, tailPred); \ - uint16x8_t vecTransp = TRGT_LOAD(pAlpha, STRIDE, tailPred); \ - \ - vecTransp = SCAL_OPACITY(vecTransp, OPACITY, tailPred); \ - \ - ALPHA_255_COMP_VEC16(vecTransp, COMPVAL); \ - \ - uint16x8_t vecAlpha = vsubq_x_u16(v256, vecTransp, tailPred); \ - \ - vecTarget = vmulq_x(vecTarget, vecAlpha, tailPred); \ - vecTarget = vmlaq_m(vecTarget, vecTransp, (uint16_t) Colour, tailPred); \ - vecTarget = vecTarget >> 8; \ - \ - vstrbq_p_u16(pTarget8, vecTarget, tailPred); \ - \ - pAlpha += (8 * ALPHA_SZ); \ - pTarget8 += 8; \ - blkCnt -= 8; \ - } \ - while (blkCnt > 0); - - -/** - RGB565 pixel color fill alpha/channel mask with/without opacity MVE intrinsic generator - - TRGT_LOAD is a contigous / strided target load function - RGB565_TRGT_LOAD / RGB565_TRGT_LOAD_STRIDE - - STRIDE is an optional vector of offset for gather load - - SCAL_OPACITY is extra alpha scaling function - RGB565_SCAL_OPACITY_NONE / RGB565_SCAL_OPACITY - - OPACITY is an optinal 8-bit vector with duplicated opacity values - (need vector format to be used with VMULH.U8) - - P_ALPHA, 8-bit or 32-bit alpha chan. pointer - - ALPHA_SZ, alpha chan width (1 or 4 for resp. 8 or 32-bit type) - - Does not generate a tail-predicated loop as relying on pack/unpack functions. - Predication is only applied in the final stage during pixel store. - */ - -#define RGB565_COLOUR_FILLING_MASK_MVE(TRGT_LOAD, STRIDE, SCAL_OPACITY, OPACITY, \ - P_ALPHA, ALPHA_SZ, COMPVAL) \ - uint16x8_t v256 = vdupq_n_u16(256); \ - \ - for (int_fast16_t y = 0; y < iHeight; y++) { \ - const uint8_t *pAlpha = (const uint8_t *)P_ALPHA; \ - uint16_t *pCurTarget = pTarget; \ - int32_t blkCnt = iWidth; \ - \ - do { \ - uint16x8_t vecTarget = vld1q(pCurTarget); \ - uint16x8_t vecTransp = TRGT_LOAD(pAlpha, STRIDE); \ - vecTransp = SCAL_OPACITY(vecTransp, OPACITY); \ - \ - ALPHA_255_COMP_VEC16(vecTransp, COMPVAL); \ - \ - uint16x8_t vecAlpha = vsubq_u16(v256, vecTransp); \ - uint16x8_t vecR, vecG, vecB; \ - \ - __arm_2d_rgb565_unpack_single_vec(vecTarget, &vecR, &vecG, &vecB); \ - \ - /* blending using alpha vector weights */ \ - vecR = vmulq(vecR, vecAlpha); \ - vecR = vmlaq(vecR, vecTransp, (uint16_t) tSrcPix.R); \ - vecR = vecR >> 8; \ - \ - vecG = vmulq(vecG, vecAlpha); \ - vecG = vmlaq(vecG, vecTransp, (uint16_t) tSrcPix.G); \ - vecG = vecG >> 8; \ - \ - vecB = vmulq(vecB, vecAlpha); \ - vecB = vmlaq(vecB, vecTransp, (uint16_t) tSrcPix.B); \ - vecB = vecB >> 8; \ - \ - vecTarget = __arm_2d_rgb565_pack_single_vec(vecR, vecG, vecB); \ - \ - /* tail predication */ \ - vst1q_p_u16(pCurTarget, vecTarget, vctp16q(blkCnt)); \ - \ - pAlpha += (8 * ALPHA_SZ); \ - pCurTarget += 8; \ - blkCnt -= 8; \ - } \ - while (blkCnt > 0); \ - \ - P_ALPHA += (iAlphaStride); \ - pTarget += (iTargetStride); \ - } - - -/** - CCCN888 pixel color fill alpha/channel mask with/without opacity MVE intrinsic generator - - TRGT_LOAD is a contigous / strided target load function - CCCN888_TRGT_LOAD / CCCN888_TRGT_LOAD_STRIDE - - STRIDE is an optional vector of offset for gather load - - SCAL_OPACITY is extra alpha scaling function - CCCN888_SCAL_OPACITY_NONE / CCCN888_SCAL_OPACITY - - OPACITY is an optinal 8-bit vector with duplicated opacity values - (need vector format to be used with VMULH.U8) - - ALPHA_SZ, alpha chan width (1 or 4 for resp. 8 or 32-bit type) - - Macro assumes pTargetCh0/1/2 & pAlpha are already setup - */ - -#define CCCN888_COLOUR_FILLING_MASK_INNER_MVE(TRGT_LOAD, STRIDE, SCAL_OPACITY, \ - OPACITY, ALPHA_SZ, COMPVAL) \ - int32_t blkCnt = iWidth; \ - \ - do { \ - mve_pred16_t tailPred = vctp16q(blkCnt); \ - \ - /* expand chan0, chan1, chan2 */ \ - uint16x8_t vecTargetC0 = vldrbq_gather_offset_z_u16(pTargetCh0, vStride4Offs, \ - tailPred); \ - uint16x8_t vecTargetC1 = vldrbq_gather_offset_z_u16(pTargetCh1, vStride4Offs, \ - tailPred); \ - uint16x8_t vecTargetC2 = vldrbq_gather_offset_z_u16(pTargetCh2, vStride4Offs, \ - tailPred); \ - uint16x8_t vecTransp = TRGT_LOAD(pAlpha, STRIDE, tailPred); \ - \ - vecTransp = SCAL_OPACITY(vecTransp, OPACITY, tailPred); \ - \ - ALPHA_255_COMP_VEC16(vecTransp, COMPVAL); \ - \ - uint16x8_t vecAlpha = vsubq_x_u16(v256, vecTransp, tailPred); \ - \ - \ - /* scale ch0 vector with alpha vector */ \ - vecTargetC0 = vmulq_x(vecTargetC0, vecAlpha, tailPred); \ - /* blend ch0 vector with input ch0 color*/ \ - vecTargetC0 = vmlaq_m(vecTargetC0, vecTransp, (uint16_t) c0, tailPred); \ - vecTargetC0 = vecTargetC0 >> 8; \ - \ - /* repeat for ch1 and ch2 */ \ - vecTargetC1 = vmulq_x(vecTargetC1, vecAlpha, tailPred); \ - vecTargetC1 = vmlaq_m(vecTargetC1, vecTransp, (uint16_t) c1, tailPred); \ - vecTargetC1 = vecTargetC1 >> 8; \ - \ - vecTargetC2 = vmulq_x(vecTargetC2, vecAlpha, tailPred); \ - vecTargetC2 = vmlaq_m(vecTargetC2, vecTransp, (uint16_t) c2, tailPred); \ - vecTargetC2 = vecTargetC2 >> 8; \ - \ - /* store and merge chan0, chan1, chan2 */ \ - vstrbq_scatter_offset_p_u16(pTargetCh0, vStride4Offs, vecTargetC0, tailPred); \ - vstrbq_scatter_offset_p_u16(pTargetCh1, vStride4Offs, vecTargetC1, tailPred); \ - vstrbq_scatter_offset_p_u16(pTargetCh2, vStride4Offs, vecTargetC2, tailPred); \ - \ - pAlpha += 8 * ALPHA_SZ; \ - pTargetCh0 += 8*4; \ - pTargetCh1 += 8*4; \ - pTargetCh2 += 8*4; \ - blkCnt -= 8; \ - } \ - while (blkCnt > 0); - - - -#define C8BIT_TRGT_LOAD(base, stride, pred) vldrbq_z_u16(base, pred) -#define C8BIT_TRGT_LOAD_STRIDE(base, stride, pred) vldrbq_gather_offset_z_u16(base, stride, pred); -#define C8BIT_SCAL_OPACITY_NONE(transp, opac, pred) transp -#define C8BIT_SCAL_OPACITY(transp, opac, pred) (uint16x8_t) vmulhq_x((uint8x16_t) transp, opac, pred) - -#define RGB565_TRGT_LOAD(base, stride) vldrbq_u16(base) -#define RGB565_TRGT_LOAD_STRIDE(base, stride) vldrbq_gather_offset_u16(base, stride); -#define RGB565_SCAL_OPACITY_NONE(transp, opac) transp -#define RGB565_SCAL_OPACITY(transp, opac) (uint16x8_t) vmulhq((uint8x16_t) transp, opac) - -#define CCCN888_TRGT_LOAD(base, stride, pred) vldrbq_z_u16(base, pred) -#define CCCN888_TRGT_LOAD_STRIDE(base, stride, pred) vldrbq_gather_offset_z_u16(base, stride, pred); -#define CCCN888_SCAL_OPACITY_NONE(transp, opac, pred) transp -#define CCCN888_SCAL_OPACITY(transp, opac, pred) (uint16x8_t) vmulhq_x((uint8x16_t) transp, opac, pred) - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_gray8_colour_filling_mask)(uint8_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint8_t * __RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint8_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t v256 = vdupq_n_u16(256); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t * pAlpha = pchAlpha; - uint8_t * pTarget8 = pTarget; - -#ifdef USE_MVE_INTRINSICS - C8BIT_COLOUR_FILLING_MASK_INNER_MVE(C8BIT_TRGT_LOAD, _, - C8BIT_SCAL_OPACITY_NONE, _, 1, 255); -#else - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - " vldrb.u16 q0, [%[pTarget]] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if alpha == 255, boost to 256 */ - " vpt.i16 eq, q1, %[alph255] \n" - " vmovt.i16 q1, #256 \n" -#endif - - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vmla.u16 q3, q1, %[Colour] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - " .unreq vecAlphaCompl \n" - : [pTarget] "+l"(pTarget8), [pAlpha] "+l" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[Colour] "r"(Colour) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[alph255] "r" (255) -#endif - :"q0", "q1", "q2", "q3", "memory"); -#endif - pchAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_gray8_colour_filling_mask_opacity)(uint8_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint8_t * __RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __RESTRICT ptCopySize, - uint8_t Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint8x16_t vOpacity = vdupq_n_u8(hwOpacity); - uint16x8_t v256 = vdupq_n_u16(256); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t * pAlpha = pchAlpha; - uint8_t * pTarget8 = pTarget; - -#ifdef USE_MVE_INTRINSICS - C8BIT_COLOUR_FILLING_MASK_INNER_MVE(C8BIT_TRGT_LOAD, _, - C8BIT_SCAL_OPACITY, vOpacity, 1, 254); -#else - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - " vldrb.u16 q0, [%[pTarget]] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if vOpacity == 254, boost to 256 */ - " vpt.i16 eq, q1, %[opa254] \n" - " vmovt.i16 q1, #256 \n" -#endif - - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vmla.u16 q3, q1, %[Colour] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - " .unreq vecAlphaCompl \n" - : [pTarget] "+l"(pTarget8), [pAlpha] "+l" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[Colour] "r"(Colour),[vOpacity] "t"(vOpacity) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[opa254] "r" (254) -#endif - :"q0", "q1", "q2", "q3", "memory"); - -#endif - pchAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_gray8_colour_filling_channel_mask)(uint8_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint32_t * __RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint8_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t v256 = vdupq_n_u16(256); - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t *pAlpha = (const uint8_t *)pwAlpha; - uint8_t * pTarget8 = pTarget; - -#ifdef USE_MVE_INTRINSICS - C8BIT_COLOUR_FILLING_MASK_INNER_MVE(C8BIT_TRGT_LOAD_STRIDE, vStride4Offs, - C8BIT_SCAL_OPACITY_NONE, _, 4, 255); -#else - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - " vldrb.u16 q0, [%[pTarget]] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if alpha == 255, boost to 256 */ - " vpt.i16 eq, q1, %[alph255] \n" - " vmovt.i16 q1, #256 \n" -#endif - - " add %[pAlpha], %[pAlpha], #(8*4) \n" - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vmla.s16 q3, q1, %[Colour] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - " .unreq vecAlphaCompl \n" - : [pTarget] "+l"(pTarget8), [pAlpha] "+r" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[Colour] "r"(Colour),[str4Offs] "t"(vStride4Offs) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[alph255] "r" (255) -#endif - :"q0", "q1", "q2", "q3", "memory"); - -#endif - pwAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_gray8_colour_filling_channel_mask_opacity)(uint8_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint32_t * __RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __RESTRICT ptCopySize, - uint8_t Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint8x16_t vOpacity = vdupq_n_u8(hwOpacity); - uint16x8_t v256 = vdupq_n_u16(256); - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t *pAlpha = (const uint8_t *)pwAlpha; - uint8_t *pTarget8 = pTarget; - -#ifdef USE_MVE_INTRINSICS - C8BIT_COLOUR_FILLING_MASK_INNER_MVE(C8BIT_TRGT_LOAD_STRIDE, vStride4Offs, - C8BIT_SCAL_OPACITY, vOpacity, 4, 254); -#else - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - " vldrb.u16 q0, [%[pTarget]] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if vOpacity == 254, boost to 256 */ - " vpt.i16 eq, q1, %[opa254] \n" - " vmovt.i16 q1, #256 \n" -#endif - - " add %[pAlpha], %[pAlpha], #(8*4) \n" - - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTarget], #8] \n" - " vmla.s16 q3, q1, %[Colour] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTarget]], #8 \n" - " letp lr, 2b \n" - "1: \n" - - " .unreq vecAlphaCompl \n" - : [pTarget] "+l"(pTarget8), [pAlpha] "+r" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[Colour] "r"(Colour),[vOpacity] "t"(vOpacity), - [str4Offs] "t"(vStride4Offs) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[opa254] "r" (254) -#endif - :"q0", "q1", "q2", "q3", "memory"); - -#endif - pwAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_colour_filling_mask)(uint16_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint8_t * __RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint16_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - __arm_2d_color_fast_rgb_t tSrcPix; - - __arm_2d_rgb565_unpack(*(&Colour), &tSrcPix); - -#ifdef USE_MVE_INTRINSICS - RGB565_COLOUR_FILLING_MASK_MVE( RGB565_TRGT_LOAD, _, - RGB565_SCAL_OPACITY_NONE, _, pchAlpha, 1, 255); -#else - /* RGB565 pack/unpack Masks */ - /* use memory rather than vmov to optimize Helium operations interleaving */ - uint16x8_t scratch[5]; - - // Unpacking Mask Red - vst1q((uint16_t*)&scratch[0], vdupq_n_u16(0x1f)); - // Unpacking Mask Green - vst1q((uint16_t*)&scratch[1], vdupq_n_u16(0x3f)); - // packing Mask Green - vst1q((uint16_t*)&scratch[2], vdupq_n_u16(0xfc)); - // packing Mask Blue - vst1q((uint16_t*)&scratch[3], vdupq_n_u16(0xf8)); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t *pAlpha = pchAlpha; - uint16_t *pCurTarget = pTarget; - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile ( - ".p2align 2 \n" - /* load scheduling */ - " vldrh.u16 q0, [%[pTarget]] \n" - " vmov.i16 q7, #0x0100 \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if alpha == 255, boost to 256 */ - " vpt.i16 eq, q1, %[alph255] \n" - " vmovt.i16 q1, #256 \n" -#endif - - // vecAlpha - " vsub.i16 q2, q7, q1 \n" - - /* RGB565 unpack */ - - /* vecAlpha * 4 for G channel upscale */ - " vmul.i16 q2, q2, %[four] \n" - /* G channel extract */ - " vshr.u16 q5, q0, #5 \n" - - /* load Unpacking Mask for R channel */ - " vldrh.u16 q7, [%[scratch], #(0*16)] \n" - " vand q4, q0, q7 \n" - - /* load Unpacking Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(1*16)] \n" - " vand q5, q5, q7 \n" - /* scale G vector with alpha vector */ - " vmul.u16 q5, q5, q2 \n" - - /* B channel */ - " vshr.u16 q6, q0, #11 \n" - - /* blend G vector with input G color*/ - " vmla.s16 q5, q1, %[G] \n" - - /* vecAlpha * 8 for R & B upscale */ - " vshl.i16 q2, q2, #1 \n" - - /* scale R vector with alpha vec */ - " vmul.u16 q4, q4, q2 \n" - - " vshr.u16 q5, q5, #8 \n" - - /* blend R vector with input R color*/ - " vmla.s16 q4, q1, %[B] \n" - - /* load packing Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(2*16)] \n" - - /* scale B vector with alpha vector */ - " vmul.u16 q6, q6, q2 \n" - " vand q5, q5, q7 \n" - - /* blend B vector with input B color*/ - " vmla.s16 q6, q1, %[R] \n" - - /* load packing Mask for B channel */ - " vldrh.u16 q7, [%[scratch], #(3*16)] \n" - - " vshr.u16 q6, q6, #8 \n" - - /* RGB 565 pack */ - - /* (G & 0x00fc), 8) */ - " vmul.i16 q5, q5, %[eight] \n" - - /* (B & 0x00f8) */ - " vand q6, q6, q7 \n" - - /* load next alpha vector */ - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " vmov.i16 q7, #0x0100 \n" - - /* pack G & B */ - " vmla.s16 q5, q6, %[twofiftysix] \n" - /* combined (R >> 8) >> 3 */ - " vshr.u16 q4, q4, #11 \n" - - /* load next target */ - " vldrh.u16 q0, [%[pTarget], #16] \n" - - /* pack R */ - " vorr q4, q4, q5 \n" - " vstrh.16 q4, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[pTarget]"+l"(pCurTarget),[pAlpha] "+l"(pAlpha),[loopCnt] "+r"(blkCnt) - :[Colour] "r"(Colour), [eight] "r" (8), [four] "r" (4), - [R] "r" (tSrcPix.R), [G] "r" (tSrcPix.G), [B] "r" (tSrcPix.B), - [twofiftysix] "r" (256), [scratch] "r" (scratch) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[alph255] "r" (255) -#endif - :"q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"); - - pchAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -#endif -} - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_colour_filling_mask_opacity)(uint16_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint8_t * __RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint16_t Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint8x16_t vOpacity = vdupq_n_u8(hwOpacity); - - __arm_2d_color_fast_rgb_t tSrcPix; - - __arm_2d_rgb565_unpack(*(&Colour), &tSrcPix); - -#ifdef USE_MVE_INTRINSICS - RGB565_COLOUR_FILLING_MASK_MVE( RGB565_TRGT_LOAD, _, - RGB565_SCAL_OPACITY, vOpacity, pchAlpha, 1, 254); -#else - /* RGB565 pack/unpack Masks + opacity */ - /* use memory rather than vmov to optimize Helium operations interleaving */ - uint16x8_t scratch[6]; - - // Unpacking Mask Red - vst1q((uint16_t*)&scratch[0], vdupq_n_u16(0x1f)); - // Unpacking Mask Green - vst1q((uint16_t*)&scratch[1], vdupq_n_u16(0x3f)); - // packing Mask Green - vst1q((uint16_t*)&scratch[2], vdupq_n_u16(0xfc)); - // packing Mask Blue - vst1q((uint16_t*)&scratch[3], vdupq_n_u16(0xf8)); - // opacity - vst1q((uint16_t*)&scratch[4], (uint16x8_t)vOpacity); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t *pAlpha = pchAlpha; - uint16_t *pCurTarget = pTarget; - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile ( - ".p2align 2 \n" - /* load scheduling */ - " vldrh.u16 q0, [%[pTarget]] \n" - " vmov.i16 q7, #0x0100 \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - /* opacity vector */ - " vldrh.u16 q6, [%[scratch], #(4*16)] \n" - " vmulh.u8 q1, q1, q6 \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if vOpacity == 254, boost to 256 */ - " vpt.i16 eq, q1, %[opa254] \n" - " vmovt.i16 q1, #256 \n" -#endif - // vecAlpha - " vsub.i16 q2, q7, q1 \n" - - /* RGB565 unpack */ - - /* vecAlpha * 4 for G channel upscale */ - " vmul.i16 q2, q2, %[four] \n" - /* G channel extract */ - " vshr.u16 q5, q0, #5 \n" - - /* load Unpacking Mask for R channel */ - " vldrh.u16 q7, [%[scratch], #(0*16)] \n" - " vand q4, q0, q7 \n" - - /* load Unpacking Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(1*16)] \n" - " vand q5, q5, q7 \n" - /* scale G vector with alpha vector */ - " vmul.u16 q5, q5, q2 \n" - - /* B channel */ - " vshr.u16 q6, q0, #11 \n" - - /* blend G vector with input G color*/ - " vmla.s16 q5, q1, %[G] \n" - - /* vecAlpha * 8 for R & B upscale */ - " vshl.i16 q2, q2, #1 \n" - - /* scale R vector with alpha vec */ - " vmul.u16 q4, q4, q2 \n" - - " vshr.u16 q5, q5, #8 \n" - - /* blend R vector with input R color*/ - " vmla.s16 q4, q1, %[B] \n" - - /* load packing Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(2*16)] \n" - - /* scale B vector with alpha vector */ - " vmul.u16 q6, q6, q2 \n" - " vand q5, q5, q7 \n" - - /* blend B vector with input B color*/ - " vmla.s16 q6, q1, %[R] \n" - - /* load packing Mask for B channel */ - " vldrh.u16 q7, [%[scratch], #(3*16)] \n" - - " vshr.u16 q6, q6, #8 \n" - - /* RGB 565 pack */ - - /* (G & 0x00fc), 8) */ - " vmul.i16 q5, q5, %[eight] \n" - - /* (B & 0x00f8) */ - " vand q6, q6, q7 \n" - - /* load next alpha vector */ - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " vmov.i16 q7, #0x0100 \n" - - /* pack G & B */ - " vmla.s16 q5, q6, %[twofiftysix] \n" - /* reload opacity and scale alpha */ - " vldrh.u16 q6, [%[scratch], #(4*16)] \n" - " vmulh.u8 q1, q1, q6 \n" - - /* combined (R >> 8) >> 3 */ - " vshr.u16 q4, q4, #11 \n" - - /* load next target */ - " vldrh.u16 q0, [%[pTarget], #16] \n" - - /* pack R */ - " vorr q4, q4, q5 \n" - " vstrh.16 q4, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[pTarget]"+r"(pCurTarget),[pAlpha] "+l"(pAlpha),[loopCnt] "+r"(blkCnt) - :[Colour] "r"(Colour), [eight] "r" (8), [four] "r" (4), - [R] "r" (tSrcPix.R), [G] "r" (tSrcPix.G), [B] "r" (tSrcPix.B), - [twofiftysix] "r" (256), [scratch] "r" (scratch) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[opa254] "r" (254) -#endif - :"q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"); - - pchAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -#endif -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_colour_filling_channel_mask)(uint16_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint32_t * __RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint16_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - __arm_2d_color_fast_rgb_t tSrcPix; - - __arm_2d_rgb565_unpack(*(&Colour), &tSrcPix); - -#ifdef USE_MVE_INTRINSICS - RGB565_COLOUR_FILLING_MASK_MVE(RGB565_TRGT_LOAD_STRIDE, vStride4Offs, - RGB565_SCAL_OPACITY_NONE, _, pwAlpha, 4, 1); -#else - /* RGB565 pack/unpack Masks */ - /* use memory rather than vmov to optimize Helium operations interleaving */ - uint16x8_t scratch[4]; - - // Unpacking Mask Red - vst1q((uint16_t*)&scratch[0], vdupq_n_u16(0x1f)); - // Unpacking Mask Green - vst1q((uint16_t*)&scratch[1], vdupq_n_u16(0x3f)); - // packing Mask Green - vst1q((uint16_t*)&scratch[2], vdupq_n_u16(0xfc)); - // packing Mask Blue - vst1q((uint16_t*)&scratch[3], vdupq_n_u16(0xf8)); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint32_t *pAlpha = pwAlpha; - uint16_t *pCurTarget = pTarget; - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile ( - ".p2align 2 \n" - /* load scheduling */ - " vldrh.u16 q0, [%[pTarget]] \n" - - " vmov.i16 q7, #0x0100 \n" - " vldrb.u16 q1, [%[pAlpha],%[str4Offs]]\n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - " add %[pAlpha], %[pAlpha],#(8*4)\n" -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if alpha == 255, boost to 256 */ - " vpt.i16 eq, q1, %[alph255] \n" - " vmovt.i16 q1, #256 \n" -#endif - // vecAlpha - " vsub.i16 q2, q7, q1 \n" - - /* RGB565 unpack */ - - /* vecAlpha * 4 for G channel upscale */ - " vmul.i16 q2, q2, %[four] \n" - /* G channel extract */ - " vshr.u16 q5, q0, #5 \n" - - /* load Unpacking Mask for R channel */ - " vldrh.u16 q7, [%[scratch], #(0*16)] \n" - " vand q4, q0, q7 \n" - - /* load Unpacking Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(1*16)] \n" - " vand q5, q5, q7 \n" - /* scale G vector with alpha vector */ - " vmul.u16 q5, q5, q2 \n" - - /* B channel */ - " vshr.u16 q6, q0, #11 \n" - - /* blend G vector with input G color*/ - " vmla.s16 q5, q1, %[G] \n" - - /* vecAlpha * 8 for R & B upscale */ - " vshl.i16 q2, q2, #1 \n" - - /* scale R vector with alpha vec */ - " vmul.u16 q4, q4, q2 \n" - - " vshr.u16 q5, q5, #8 \n" - - /* blend R vector with input R color*/ - " vmla.s16 q4, q1, %[B] \n" - - /* load packing Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(2*16)] \n" - - /* scale B vector with alpha vector */ - " vmul.u16 q6, q6, q2 \n" - " vand q5, q5, q7 \n" - - /* blend B vector with input B color*/ - " vmla.s16 q6, q1, %[R] \n" - - /* load packing Mask for B channel */ - " vldrh.u16 q7, [%[scratch], #(3*16)] \n" - - " vshr.u16 q6, q6, #8 \n" - - /* RGB 565 pack */ - - /* (G & 0x00fc), 8) */ - " vmul.i16 q5, q5, %[eight] \n" - - /* (B & 0x00f8) */ - " vand q6, q6, q7 \n" - - /* load next alpha vector */ - " vldrb.u16 q1, [%[pAlpha],%[str4Offs]]\n" - - " vmov.i16 q7, #0x0100 \n" - - /* pack G & B */ - " vmla.s16 q5, q6, %[twofiftysix] \n" - /* combined (R >> 8) >> 3 */ - " vshr.u16 q4, q4, #11 \n" - - /* load next target */ - " vldrh.u16 q0, [%[pTarget], #16] \n" - - /* pack R */ - " vorr q4, q4, q5 \n" - " vstrh.16 q4, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[pTarget]"+r"(pCurTarget),[pAlpha] "+r"(pAlpha),[loopCnt] "+r"(blkCnt) - :[Colour] "r"(Colour), [eight] "r" (8), [four] "r" (4), - [R] "r" (tSrcPix.R), [G] "r" (tSrcPix.G), [B] "r" (tSrcPix.B), - [twofiftysix] "r" (256), [scratch] "r" (scratch), [str4Offs] "t"(vStride4Offs) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[alph255] "r" (255) -#endif - :"q0", "q1", "q2", "q4", "q5", "q6", "q7", "memory"); - - pwAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -#endif -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_rgb565_colour_filling_channel_mask_opacity)(uint16_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint32_t * __RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint16_t Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - uint8x16_t vOpacity = vdupq_n_u8(hwOpacity); - __arm_2d_color_fast_rgb_t tSrcPix; - - __arm_2d_rgb565_unpack(*(&Colour), &tSrcPix); - -#ifdef USE_MVE_INTRINSICS - - RGB565_COLOUR_FILLING_MASK_MVE(RGB565_TRGT_LOAD_STRIDE, vStride4Offs, - RGB565_SCAL_OPACITY, vOpacity, pwAlpha, 4, 2); -#else - /* RGB565 pack/unpack Masks + opacity */ - /* use memory rather than vmov to optimize Helium operations interleaving */ - uint16x8_t scratch[5]; - - // Unpacking Mask Red - vst1q((uint16_t*)&scratch[0], vdupq_n_u16(0x1f)); - // Unpacking Mask Green - vst1q((uint16_t*)&scratch[1], vdupq_n_u16(0x3f)); - // packing Mask Green - vst1q((uint16_t*)&scratch[2], vdupq_n_u16(0xfc)); - // packing Mask Blue - vst1q((uint16_t*)&scratch[3], vdupq_n_u16(0xf8)); - // opacity - vst1q((uint16_t*)&scratch[4], (uint16x8_t)vOpacity); - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint32_t *pAlpha = pwAlpha; - uint16_t *pCurTarget = pTarget; - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile ( - ".p2align 2 \n" - /* load scheduling */ - " vldrh.u16 q0, [%[pTarget]] \n" - - " vmov.i16 q7, #0x0100 \n" - " vldrb.u16 q1, [%[pAlpha],%[str4Offs]]\n" - /* opacity vector */ - " vldrh.u16 q6, [%[scratch], #(4*16)] \n" - " vmulh.u8 q1, q1, q6 \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - " add %[pAlpha], %[pAlpha],#(8*4)\n" -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if vOpacity == 254, boost to 256 */ - " vpt.i16 eq, q1, %[opa254] \n" - " vmovt.i16 q1, #256 \n" -#endif - // vecAlpha - " vsub.i16 q2, q7, q1 \n" - - /* RGB565 unpack */ - - /* vecAlpha * 4 for G channel upscale */ - " vmul.i16 q2, q2, %[four] \n" - /* G channel extract */ - " vshr.u16 q5, q0, #5 \n" - - /* load Unpacking Mask for R channel */ - " vldrh.u16 q7, [%[scratch], #(0*16)] \n" - " vand q4, q0, q7 \n" - - /* load Unpacking Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(1*16)] \n" - " vand q5, q5, q7 \n" - /* scale G vector with alpha vector */ - " vmul.u16 q5, q5, q2 \n" - - /* B channel */ - " vshr.u16 q6, q0, #11 \n" - - /* blend G vector with input G color*/ - " vmla.s16 q5, q1, %[G] \n" - - /* vecAlpha * 8 for R & B upscale */ - " vshl.i16 q2, q2, #1 \n" - - /* scale R vector with alpha vec */ - " vmul.u16 q4, q4, q2 \n" - - " vshr.u16 q5, q5, #8 \n" - - /* blend R vector with input R color*/ - " vmla.s16 q4, q1, %[B] \n" - - /* load packing Mask for G channel */ - " vldrh.u16 q7, [%[scratch], #(2*16)] \n" - - /* scale B vector with alpha vector */ - " vmul.u16 q6, q6, q2 \n" - " vand q5, q5, q7 \n" - - /* blend B vector with input B color*/ - " vmla.s16 q6, q1, %[R] \n" - - /* load packing Mask for B channel */ - " vldrh.u16 q7, [%[scratch], #(3*16)] \n" - - " vshr.u16 q6, q6, #8 \n" - - /* RGB 565 pack */ - - /* (G & 0x00fc), 8) */ - " vmul.i16 q5, q5, %[eight] \n" - - /* (B & 0x00f8) */ - " vand q6, q6, q7 \n" - - /* load next alpha vector */ - " vldrb.u16 q1, [%[pAlpha],%[str4Offs]]\n" - - " vmov.i16 q7, #0x0100 \n" - - /* pack G & B */ - " vmla.s16 q5, q6, %[twofiftysix] \n" - /* combined (R >> 8) >> 3 */ - " vldrh.u16 q6, [%[scratch], #(4*16)] \n" - " vmulh.u8 q1, q1, q6 \n" - " vshr.u16 q4, q4, #11 \n" - - /* load next target */ - " vldrh.u16 q0, [%[pTarget], #16] \n" - - /* pack R */ - " vorr q4, q4, q5 \n" - " vstrh.16 q4, [%[pTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[pTarget]"+r"(pCurTarget),[pAlpha] "+r"(pAlpha),[loopCnt] "+r"(blkCnt) - :[Colour] "r"(Colour), [eight] "r" (8), [four] "r" (4), - [R] "r" (tSrcPix.R), [G] "r" (tSrcPix.G), [B] "r" (tSrcPix.B), - [twofiftysix] "r" (256), [scratch] "r" (scratch), [str4Offs] "t"(vStride4Offs) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[opa254] "r" (254) -#endif - :"q0", "q1", "q2", "q4", "q5", "q6", "q7", "memory"); - - pwAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -#endif -} - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_colour_filling_mask)(uint32_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint8_t * __RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t v256 = vdupq_n_u16(256); - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - uint16_t c0, c1, c2; - - c0 = Colour & 0xff; - c1 = (Colour >> 8) & 0xff; - c2 = (Colour >> 16) & 0xff; - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t * pAlpha = pchAlpha; - uint8_t * pTargetCh0 = (uint8_t*)pTarget; - uint8_t * pTargetCh1 = pTargetCh0 + 1; - uint8_t * pTargetCh2 = pTargetCh0 + 2; - -#ifdef USE_MVE_INTRINSICS - - CCCN888_COLOUR_FILLING_MASK_INNER_MVE(CCCN888_TRGT_LOAD, _, - CCCN888_SCAL_OPACITY_NONE, _, 1, 255); -#else - - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - /* expand chan0 */ - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if alpha == 255, boost to 256 */ - " vpt.i16 eq, q1, %[alph255] \n" - " vmovt.i16 q1, #256 \n" -#endif - - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - /* scale ch0 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan1 */ - " vldrb.u16 q0, [%[pTargetCh1], %[str4Offs]] \n" - /* blend ch0 vector with input ch0 color*/ - " vmla.s16 q3, q1, %[c0] \n" - " vshr.u16 q3, q3, #8 \n" - - " vstrb.u16 q3, [%[pTargetCh0], %[str4Offs]] \n" - - /* scale ch1 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan2 */ - " vldrb.u16 q0, [%[pTargetCh2], %[str4Offs]] \n" - /* blend ch1 vector with input ch1 color*/ - " vmla.s16 q3, q1, %[c1] \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh1], %[str4Offs]] \n" - - " adds %[pTargetCh0], #32 \n" - " adds %[pTargetCh1], #32 \n" - - /* scale ch2 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - - /* blend ch2 vector with input ch2 color*/ - " vmla.s16 q3, q1, %[c2] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh2], %[str4Offs]] \n" - - " add.w %[pTargetCh2], %[pTargetCh2], #32 \n" - - " letp lr, 2b \n" - "1: \n" - - " .unreq vecAlphaCompl \n" - - :[pTargetCh0] "+r"(pTargetCh0), [pTargetCh1] "+r"(pTargetCh1), - [pTargetCh2] "+r"(pTargetCh2), [pAlpha] "+l" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[str4Offs] "t" (vStride4Offs), - [c0] "r"(c0), [c1] "r"(c1), [c2] "r"(c2) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[alph255] "r" (255) -#endif - :"q0", "q1", "q2", "q3", "memory", "cc"); - -#endif - pchAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_colour_filling_mask_opacity)(uint32_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint8_t * __RESTRICT pchAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t v256 = vdupq_n_u16(256); - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - uint8x16_t vOpacity = vdupq_n_u8(hwOpacity); - uint16_t c0, c1, c2; - - c0 = Colour & 0xff; - c1 = (Colour >> 8) & 0xff; - c2 = (Colour >> 16) & 0xff; - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t * pAlpha = pchAlpha; - uint8_t * pTargetCh0 = (uint8_t*)pTarget; - uint8_t * pTargetCh1 = pTargetCh0 + 1; - uint8_t * pTargetCh2 = pTargetCh0 + 2; - -#ifdef USE_MVE_INTRINSICS - - CCCN888_COLOUR_FILLING_MASK_INNER_MVE(CCCN888_TRGT_LOAD, _, - CCCN888_SCAL_OPACITY, vOpacity, 1, 254); -#else - - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - /* expand chan0 */ - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if vOpacity == 254, boost to 256 */ - " vpt.i16 eq, q1, %[opa254] \n" - " vmovt.i16 q1, #256 \n" -#endif - - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - /* scale ch0 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan1 */ - " vldrb.u16 q0, [%[pTargetCh1], %[str4Offs]] \n" - /* blend ch0 vector with input ch0 color*/ - " vmla.s16 q3, q1, %[c0] \n" - " vshr.u16 q3, q3, #8 \n" - - " vstrb.u16 q3, [%[pTargetCh0], %[str4Offs]] \n" - - /* scale ch1 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan2 */ - " vldrb.u16 q0, [%[pTargetCh2], %[str4Offs]] \n" - /* blend ch1 vector with input ch1 color*/ - " vmla.s16 q3, q1, %[c1] \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh1], %[str4Offs]] \n" - - " adds %[pTargetCh0], #32 \n" - " adds %[pTargetCh1], #32 \n" - - /* scale ch2 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - - /* blend ch2 vector with input ch2 color*/ - " vmla.s16 q3, q1, %[c2] \n" - " vldrb.u16 q1, [%[pAlpha]], #8 \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh2], %[str4Offs]] \n" - - " add.w %[pTargetCh2], %[pTargetCh2], #32 \n" - - " letp lr, 2b \n" - "1: \n" - - :[pTargetCh0] "+r"(pTargetCh0), [pTargetCh1] "+r"(pTargetCh1), - [pTargetCh2] "+r"(pTargetCh2), [pAlpha] "+l" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[str4Offs] "t" (vStride4Offs), - [vOpacity] "t"(vOpacity), - [c0] "r"(c0), [c1] "r"(c1), [c2] "r"(c2) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[opa254] "r" (254) -#endif - :"q0", "q1", "q2", "q3", "memory", "cc"); - -#endif - pchAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_colour_filling_channel_mask)(uint32_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint32_t * __RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * __RESTRICT ptCopySize, - uint32_t Colour) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t v256 = vdupq_n_u16(256); - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - uint16_t c0, c1, c2; - - c0 = Colour & 0xff; - c1 = (Colour >> 8) & 0xff; - c2 = (Colour >> 16) & 0xff; - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t *pAlpha = (const uint8_t *)pwAlpha; - uint8_t * pTargetCh0 = (uint8_t*)pTarget; - uint8_t * pTargetCh1 = pTargetCh0 + 1; - uint8_t * pTargetCh2 = pTargetCh0 + 2; - -#ifdef USE_MVE_INTRINSICS - - CCCN888_COLOUR_FILLING_MASK_INNER_MVE(CCCN888_TRGT_LOAD_STRIDE, vStride4Offs, - CCCN888_SCAL_OPACITY_NONE, _, 4, 255); -#else - - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - /* expand chan0 */ - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if alpha == 255, boost to 256 */ - " vpt.i16 eq, q1, %[alph255] \n" - " vmovt.i16 q1, #256 \n" -#endif - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - - /* scale ch0 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan1 */ - " vldrb.u16 q0, [%[pTargetCh1], %[str4Offs]] \n" - /* blend ch0 vector with input ch0 color*/ - " vmla.s16 q3, q1, %[c0] \n" - " vshr.u16 q3, q3, #8 \n" - - " vstrb.u16 q3, [%[pTargetCh0], %[str4Offs]] \n" - - /* scale ch1 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan2 */ - " vldrb.u16 q0, [%[pTargetCh2], %[str4Offs]] \n" - /* blend ch1 vector with input ch1 color*/ - " vmla.s16 q3, q1, %[c1] \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh1], %[str4Offs]] \n" - - " adds %[pAlpha], #32 \n" - " adds %[pTargetCh0], #32 \n" - - - /* scale ch2 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - - /* blend ch2 vector with input ch2 color*/ - " vmla.s16 q3, q1, %[c2] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh2], %[str4Offs]] \n" - - " adds %[pTargetCh1], #32 \n" - " adds %[pTargetCh2], #32 \n" - - " letp lr, 2b \n" - "1: \n" - - :[pTargetCh0] "+r"(pTargetCh0), [pTargetCh1] "+r"(pTargetCh1), - [pTargetCh2] "+r"(pTargetCh2), [pAlpha] "+r" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[str4Offs] "t" (vStride4Offs), - [c0] "r"(c0), [c1] "r"(c1), [c2] "r"(c2) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[alph255] "r" (255) -#endif - :"q0", "q1", "q2", "q3", "memory", "cc"); - -#endif - pwAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - - - -__OVERRIDE_WEAK -void __MVE_WRAPPER( __arm_2d_impl_cccn888_colour_filling_channel_mask_opacity)(uint32_t * __RESTRICT pTarget, - int16_t iTargetStride, - uint32_t * __RESTRICT pwAlpha, - int16_t iAlphaStride, - arm_2d_size_t * - __RESTRICT ptCopySize, - uint32_t Colour, - uint_fast16_t hwOpacity) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - uint16x8_t v256 = vdupq_n_u16(256); - uint16x8_t vStride4Offs = vidupq_n_u16(0, 4); - uint8x16_t vOpacity = vdupq_n_u8(hwOpacity); - uint16_t c0, c1, c2; - - c0 = Colour & 0xff; - c1 = (Colour >> 8) & 0xff; - c2 = (Colour >> 16) & 0xff; - - for (int_fast16_t y = 0; y < iHeight; y++) { - const uint8_t *pAlpha = (const uint8_t *)pwAlpha; - uint8_t * pTargetCh0 = (uint8_t*)pTarget; - uint8_t * pTargetCh1 = pTargetCh0 + 1; - uint8_t * pTargetCh2 = pTargetCh0 + 2; - -#ifdef USE_MVE_INTRINSICS - - CCCN888_COLOUR_FILLING_MASK_INNER_MVE(CCCN888_TRGT_LOAD_STRIDE, vStride4Offs, - CCCN888_SCAL_OPACITY, vOpacity, 4, 254); -#else - - register unsigned blkCnt __asm("lr"); - blkCnt = iWidth; - - __asm volatile( - "vecAlphaCompl .req q2 \n" - - ".p2align 2 \n" - /* expand chan0 */ - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - /* if vOpacity == 254, boost to 256 */ - " vpt.i16 eq, q1, %[opa254] \n" - " vmovt.i16 q1, #256 \n" -#endif - - " vsub.i16 vecAlphaCompl, %[vec256], q1 \n" - /* scale ch0 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan1 */ - " vldrb.u16 q0, [%[pTargetCh1], %[str4Offs]] \n" - /* blend ch0 vector with input ch0 color*/ - " vmla.s16 q3, q1, %[c0] \n" - " vshr.u16 q3, q3, #8 \n" - - " vstrb.u16 q3, [%[pTargetCh0], %[str4Offs]] \n" - - /* scale ch1 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - - /* expand chan2 */ - " vldrb.u16 q0, [%[pTargetCh2], %[str4Offs]] \n" - /* blend ch1 vector with input ch1 color*/ - " vmla.s16 q3, q1, %[c1] \n" - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh1], %[str4Offs]] \n" - - " adds %[pAlpha], #32 \n" - " adds %[pTargetCh0], #32 \n" - - - /* scale ch2 vector with alpha vector */ - " vmul.u16 q3, q0, vecAlphaCompl \n" - " vldrb.u16 q0, [%[pTargetCh0], %[str4Offs]] \n" - - /* blend ch2 vector with input ch2 color*/ - " vmla.s16 q3, q1, %[c2] \n" - " vldrb.u16 q1, [%[pAlpha], %[str4Offs]] \n" - " vmulh.u8 q1, q1, %[vOpacity] \n" - - " vshr.u16 q3, q3, #8 \n" - " vstrb.u16 q3, [%[pTargetCh2], %[str4Offs]] \n" - - " adds %[pTargetCh1], #32 \n" - " adds %[pTargetCh2], #32 \n" - - " letp lr, 2b \n" - "1: \n" - - :[pTargetCh0] "+r"(pTargetCh0), [pTargetCh1] "+r"(pTargetCh1), - [pTargetCh2] "+r"(pTargetCh2), [pAlpha] "+r" (pAlpha), [loopCnt] "+r"(blkCnt) - :[vec256] "t" (v256),[str4Offs] "t" (vStride4Offs), [vOpacity] "t"(vOpacity), - [c0] "r"(c0), [c1] "r"(c1), [c2] "r"(c2) -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_ALPHA_255_COMPENSATION__) - ,[opa254] "r" (254) -#endif - :"q0", "q1", "q2", "q3", "memory", "cc"); - -#endif - pwAlpha += (iAlphaStride); - pTarget += (iTargetStride); - } -} - - -/* use macro expansion of fill/copy with masking */ - -#define __API_CAFWM_COLOUR gray8 - -#include "__arm_2d_alpha_mask_helium.inc" - -#define __API_CAFWM_CFG_1_HORIZONTAL_LINE 1 -#define __API_CAFWM_COLOUR gray8 - -#include "__arm_2d_alpha_mask_helium.inc" - -#define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 1 -#define __API_CAFWM_COLOUR gray8 - -#include "__arm_2d_alpha_mask_helium.inc" - - - -#define __API_CAFWM_COLOUR rgb565 - -#include "__arm_2d_alpha_mask_helium.inc" - -#define __API_CAFWM_CFG_1_HORIZONTAL_LINE 1 -#define __API_CAFWM_COLOUR rgb565 - -#include "__arm_2d_alpha_mask_helium.inc" - -#define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 1 -#define __API_CAFWM_COLOUR rgb565 - -#include "__arm_2d_alpha_mask_helium.inc" - - - - -#define __API_CAFWM_COLOUR cccn888 - -#include "__arm_2d_alpha_mask_helium.inc" - -#define __API_CAFWM_CFG_1_HORIZONTAL_LINE 1 -#define __API_CAFWM_COLOUR cccn888 - -#include "__arm_2d_alpha_mask_helium.inc" - -#define __API_CAFWM_CFG_CHANNEL_8in32_SUPPORT 1 -#define __API_CAFWM_COLOUR cccn888 - -#include "__arm_2d_alpha_mask_helium.inc" - - - -/*----------------------------------------------------------------------------* - * Assembly Patches * - *----------------------------------------------------------------------------*/ - -#if defined(__IS_COMPILER_GCC__) && __IS_COMPILER_GCC__ - -__OVERRIDE_WEAK -void ARM_2D_WRAP_FUNC( __MVE_WRAPPER( __arm_2d_impl_rgb565_masks_fill))( - uint16_t * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - uint8_t * __RESTRICT pchSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * __RESTRICT ptSourceMaskSize, - uint16_t * __RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - uint8_t * __RESTRICT pchTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * __RESTRICT ptTargetMaskSize) -{ - uint8_t *__RESTRICT pchTargetMaskLineBase = pchTargetMaskBase; - uint16x8_t v256 = vdupq_n_u16(256); - -#ifndef USE_MVE_INTRINSICS - uint16x8_t scratch[5]; - - /* vector of 256 avoiding use of vdup to increase overlap efficiency*/ - vst1q((uint16_t *) & scratch[0], v256); - /* scratch[1] is temporary for blended Red chan. vector */ - - /* Unpacking Mask Red */ - vst1q((uint16_t *) & scratch[2], vdupq_n_u16(0x00fc)); - /* B channel packing mask */ - vst1q((uint16_t *) & scratch[3], vdupq_n_u16(0xf800)); - /* G channel packing Mask */ - vst1q((uint16_t *) & scratch[4], vdupq_n_u16(0x07e0)); - - /* use of fixed point mult instead of vshr to increase overlap efficiency */ - const int16_t inv_2pow3 = 1 << (15 - 3); /* 1/(2^3) in Q.15 */ -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - uint16_t *__RESTRICT ptSource = ptSourceBase; - uint8_t *pchSourceMask = pchSourceMaskBase; - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - uint16_t *__RESTRICT ptTarget = ptTargetBase; - uint8_t *__RESTRICT pchTargetMask = pchTargetMaskLineBase; - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - uint16_t *__RESTRICT ptSrc = ptSource; - uint8_t *__RESTRICT pchSrcMsk = pchSourceMask; - uint16_t *__RESTRICT ptTargetCur = ptTarget; - uint8_t *__RESTRICT pchTargetMaskCur = pchTargetMask; - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt = wLength; - - do { - uint16x8_t vecTarget = vld1q(ptTargetCur); - uint16x8_t vecSource = vld1q(ptSrc); - uint16x8_t vecSrcMsk = vldrbq_u16(pchSrcMsk); - uint16x8_t vecTargetMask = vldrbq_u16(pchTargetMaskCur); - uint16x8_t vecHwOpacity = - vsubq_u16(v256, (vecSrcMsk * vecTargetMask) >> 8); - - vecTarget = __arm_2d_rgb565_blending_opacity_single_vec( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - vst1q_p_u16(ptTargetCur, vecTarget, vctp16q(blkCnt)); - - pchSrcMsk += 8; - pchTargetMaskCur += 8; - ptTargetCur += 8; - ptSrc += 8; - - blkCnt -= 8; - } - while (blkCnt > 0); - -#else - register unsigned blkCnt __asm("lr"); - blkCnt = wLength; - - __asm volatile ( - /* R & B mask */ - "vecRBUnpackMask .req q7 \n" - "vecAlpha .req q5 \n" - "vecHwOpacity .req q3 \n" - - /* preload */ - " vldrb.u16 q0, [%[pchSrcMsk]], #8 \n" - " vmov.i16 vecRBUnpackMask, #0x00f8 \n" - " vldrb.u16 q5, [%[pchTargetMask]], #8 \n" - - ".p2align 2 \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - /* vecSrcMsk * vecTargetMask */ - " vmul.i16 q0, q5, q0 \n" - " vldrh.u16 q6, [%[ptTarget]] \n" - " vshr.u16 vecAlpha, q0, #8 \n" - /* 256-dup vector */ - " vldrh.u16 q1, [%[scratch], #(16*0)] \n" - /* vecHwOpacity = - vsubq_u16(v256, (vecSrcMsk * vecTargetMask) >> 8) */ - " vsub.i16 vecHwOpacity, q1, vecAlpha \n" - " vldrh.u16 q1, [%[ptSrc]], #16 \n" - /* mimic vshl #3 */ - " vshl.u16 q0, q6, #3 \n" - " vmul.i16 q4, q1, %[eight] \n" - /* vecR extract and scale */ - " vand q0, q0, vecRBUnpackMask \n" - " vmul.i16 q0, vecHwOpacity, q0 \n" - /* vecSrcR extract and scale */ - " vand q4, q4, vecRBUnpackMask \n" - " vmul.i16 q4, vecAlpha, q4 \n" - /* 0xfc G-mask */ - " vldrw.u32 q2, [%[scratch], #(16*2)] \n" - " vadd.i16 q4, q0, q4 \n" - /* push blended R */ - " vstrw.32 q4, [%[scratch], #(16*1)] \n" - /* mimic vshr.u16 q4, q6, #3 */ - " vqdmulh.s16 q4, q6, %[inv_2pow3] \n" - " vshr.u16 q0, q1, #3 \n" - /* vecG extract and scale */ - " vand q4, q4, q2 \n" - " vmul.i16 q4, vecHwOpacity, q4 \n" - /* vecSrcG extract and scale */ - " vand q0, q0, q2 \n" - " vmul.i16 q2, vecAlpha, q0 \n" - " vshr.u16 q0, q1, #8 \n" - /* blended G */ - /* vadd.i16 q2, q4, q2 - addition using vmla for more efficient overlap */ - " vmla.s16 q2, q4, %[one] \n" - /* vecB extract and scale */ - " vshr.u16 q4, q6, #8 \n" - " vand q4, q4, vecRBUnpackMask \n" - " vmul.i16 q4, vecHwOpacity, q4 \n" - /* vecSrcB extract and scale */ - " vand q0, q0, vecRBUnpackMask \n" - " vmul.i16 q0, vecAlpha, q0 \n" - - ".unreq vecAlpha \n" - ".unreq vecHwOpacity \n" - ".unreq vecRBUnpackMask \n" - - /* reload blended R */ - " vldrw.u32 q1, [%[scratch], #(16*1)] \n" - /* blended B - vadd.i16 q0, q4, q0 - addition using vmla for more efficient overlap */ - " vmla.s16 q0, q4, %[one] \n" - /* pack R */ - " vshr.u16 q3, q1, #11 \n" - /* B channel packing mask 0xf800 */ - " vldrw.u32 q4, [%[scratch], #(16*3)] \n" - " vand q0, q0, q4 \n" - /* accumulate R & B */ - " vorr q4, q0, q3 \n" - /* G channel packing mask 0x07e0 */ - " vldrw.u32 q3, [%[scratch], #(16*4)] \n" - " vshr.u16 q2, q2, #5 \n" - /* load next source mask */ - " vldrb.u16 q0, [%[pchSrcMsk]], #8 \n" - /* G channel masking */ - " vand q2, q2, q3 \n" - /* load next target mask */ - " vldrb.u16 q5, [%[pchTargetMask]], #8 \n" - /* pack G with R.B */ - " vorr q4, q4, q2 \n" - " vstrh.16 q4, [%[ptTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[ptTarget] "+r"(ptTargetCur),[ptSrc] "+r"(ptSrc), - [pchTargetMask] "+l"(pchTargetMaskCur),[pchSrcMsk] "+l"(pchSrcMsk), - [loopCnt] "+r"(blkCnt) - :[scratch] "r" (scratch),[eight] "r"(8),[inv_2pow3] "r"(inv_2pow3), - [one] "r" (1) - :"q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"); - -#endif - ptTarget += wLength; - pchTargetMask += wLength; - - wLengthLeft -= wLength; - } while (wLengthLeft); - - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - pchSourceMask = pchSourceMaskBase; - iSourceMaskY = 0; - } else { - pchSourceMask += iSourceMaskStride; - } - #else - pchSourceMask += iSourceMaskStride; - #endif - - pchTargetMaskLineBase += iTargetMaskStride; - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - - - -__OVERRIDE_WEAK -void ARM_2D_WRAP_FUNC( __MVE_WRAPPER( __arm_2d_impl_rgb565_src_msk_1h_des_msk_fill))( - uint16_t * __RESTRICT ptSourceBase, - int16_t iSourceStride, - arm_2d_size_t * __RESTRICT ptSourceSize, - uint8_t * __RESTRICT pchSourceMaskBase, - int16_t iSourceMaskStride, - arm_2d_size_t * __RESTRICT ptSourceMaskSize, - uint16_t * __RESTRICT ptTargetBase, - int16_t iTargetStride, - arm_2d_size_t * __RESTRICT ptTargetSize, - uint8_t * __RESTRICT pchTargetMaskBase, - int16_t iTargetMaskStride, - arm_2d_size_t * __RESTRICT ptTargetMaskSize) -{ - uint8_t *__RESTRICT pchTargetMaskLineBase = pchTargetMaskBase; - uint16x8_t v256 = vdupq_n_u16(256); - -#ifndef USE_MVE_INTRINSICS - uint16x8_t scratch[5]; - - /* vector of 256 avoiding use of vdup to increase overlap efficiency*/ - vst1q((uint16_t *) & scratch[0], v256); - /* scratch[1] is temporary for blended Red chan. vector */ - - /* Unpacking Mask Red */ - vst1q((uint16_t *) & scratch[2], vdupq_n_u16(0x00fc)); - /* B channel packing mask */ - vst1q((uint16_t *) & scratch[3], vdupq_n_u16(0xf800)); - /* G channel packing Mask */ - vst1q((uint16_t *) & scratch[4], vdupq_n_u16(0x07e0)); - - /* use of fixed point mult instead of vshr to increase overlap efficiency */ - const int16_t inv_2pow3 = 1 << (15 - 3); /* 1/(2^3) in Q.15 */ -#endif - - for (int_fast16_t iTargetY = 0; iTargetY < ptTargetSize->iHeight;) { - uint16_t *__RESTRICT ptSource = ptSourceBase; - uint8_t *pchSourceMask = pchSourceMaskBase; - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - int_fast16_t iSourceMaskY = 0; - #endif - - for (int_fast16_t iSourceY = 0; iSourceY < ptSourceSize->iHeight; iSourceY++) { - uint16_t *__RESTRICT ptTarget = ptTargetBase; - uint8_t *__RESTRICT pchTargetMask = pchTargetMaskLineBase; - uint_fast32_t wLengthLeft = ptTargetSize->iWidth; - - do { - uint_fast32_t wLength = MIN(wLengthLeft, ptSourceSize->iWidth); - uint16_t *__RESTRICT ptSrc = ptSource; - uint8_t *__RESTRICT pchSrcMsk = pchSourceMask; - uint16_t *__RESTRICT ptTargetCur = ptTarget; - uint8_t *__RESTRICT pchTargetMaskCur = pchTargetMask; - -#ifdef USE_MVE_INTRINSICS - int32_t blkCnt = wLength; - - do { - uint16x8_t vecTarget = vld1q(ptTargetCur); - uint16x8_t vecSource = vld1q(ptSrc); - uint16x8_t vecSrcMsk = vldrbq_u16(pchSrcMsk); - uint16x8_t vecTargetMask = vldrbq_u16(pchTargetMaskCur); - uint16x8_t vecHwOpacity = - vsubq_u16(v256, (vecSrcMsk * vecTargetMask) >> 8); - - vecTarget = __arm_2d_rgb565_blending_opacity_single_vec( - vecTarget, vecSource, vecHwOpacity); - /* tail predication */ - vst1q_p_u16(ptTargetCur, vecTarget, vctp16q(blkCnt)); - - pchSrcMsk += 8; - pchTargetMaskCur += 8; - ptTargetCur += 8; - ptSrc += 8; - - blkCnt -= 8; - } - while (blkCnt > 0); - -#else - register unsigned blkCnt __asm("lr"); - blkCnt = wLength; - - __asm volatile ( - /* R & B mask */ - "vecRBUnpackMask .req q7 \n" - "vecAlpha .req q5 \n" - "vecHwOpacity .req q3 \n" - - /* preload */ - " vldrb.u16 q0, [%[pchSrcMsk]], #8 \n" - " vmov.i16 vecRBUnpackMask, #0x00f8 \n" - " vldrb.u16 q5, [%[pchTargetMask]], #8 \n" - - ".p2align 2 \n" - " wlstp.16 lr, %[loopCnt], 1f \n" - "2: \n" - /* vecSrcMsk * vecTargetMask */ - " vmul.i16 q0, q5, q0 \n" - " vldrh.u16 q6, [%[ptTarget]] \n" - " vshr.u16 vecAlpha, q0, #8 \n" - /* 256-dup vector */ - " vldrh.u16 q1, [%[scratch], #(16*0)] \n" - /* vecHwOpacity = - vsubq_u16(v256, (vecSrcMsk * vecTargetMask) >> 8) */ - " vsub.i16 vecHwOpacity, q1, vecAlpha \n" - " vldrh.u16 q1, [%[ptSrc]], #16 \n" - /* mimic vshl #3 */ - " vshl.u16 q0, q6, #3 \n" - " vmul.i16 q4, q1, %[eight] \n" - /* vecR extract and scale */ - " vand q0, q0, vecRBUnpackMask \n" - " vmul.i16 q0, vecHwOpacity, q0 \n" - /* vecSrcR extract and scale */ - " vand q4, q4, vecRBUnpackMask \n" - " vmul.i16 q4, vecAlpha, q4 \n" - /* 0xfc G-mask */ - " vldrw.u32 q2, [%[scratch], #(16*2)] \n" - " vadd.i16 q4, q0, q4 \n" - /* push blended R */ - " vstrw.32 q4, [%[scratch], #(16*1)] \n" - /* mimic vshr.u16 q4, q6, #3 */ - " vqdmulh.s16 q4, q6, %[inv_2pow3] \n" - " vshr.u16 q0, q1, #3 \n" - /* vecG extract and scale */ - " vand q4, q4, q2 \n" - " vmul.i16 q4, vecHwOpacity, q4 \n" - /* vecSrcG extract and scale */ - " vand q0, q0, q2 \n" - " vmul.i16 q2, vecAlpha, q0 \n" - " vshr.u16 q0, q1, #8 \n" - /* blended G */ - /* vadd.i16 q2, q4, q2 - addition using vmla for more efficient overlap */ - " vmla.s16 q2, q4, %[one] \n" - /* vecB extract and scale */ - " vshr.u16 q4, q6, #8 \n" - " vand q4, q4, vecRBUnpackMask \n" - " vmul.i16 q4, vecHwOpacity, q4 \n" - /* vecSrcB extract and scale */ - " vand q0, q0, vecRBUnpackMask \n" - " vmul.i16 q0, vecAlpha, q0 \n" - - ".unreq vecAlpha \n" - ".unreq vecHwOpacity \n" - ".unreq vecRBUnpackMask \n" - - /* reload blended R */ - " vldrw.u32 q1, [%[scratch], #(16*1)] \n" - /* blended B - vadd.i16 q0, q4, q0 - addition using vmla for more efficient overlap */ - " vmla.s16 q0, q4, %[one] \n" - /* pack R */ - " vshr.u16 q3, q1, #11 \n" - /* B channel packing mask 0xf800 */ - " vldrw.u32 q4, [%[scratch], #(16*3)] \n" - " vand q0, q0, q4 \n" - /* accumulate R & B */ - " vorr q4, q0, q3 \n" - /* G channel packing mask 0x07e0 */ - " vldrw.u32 q3, [%[scratch], #(16*4)] \n" - " vshr.u16 q2, q2, #5 \n" - /* load next source mask */ - " vldrb.u16 q0, [%[pchSrcMsk]], #8 \n" - /* G channel masking */ - " vand q2, q2, q3 \n" - /* load next target mask */ - " vldrb.u16 q5, [%[pchTargetMask]], #8 \n" - /* pack G with R.B */ - " vorr q4, q4, q2 \n" - " vstrh.16 q4, [%[ptTarget]], #16 \n" - " letp lr, 2b \n" - "1: \n" - :[ptTarget] "+r"(ptTargetCur),[ptSrc] "+r"(ptSrc), - [pchTargetMask] "+l"(pchTargetMaskCur),[pchSrcMsk] "+l"(pchSrcMsk), - [loopCnt] "+r"(blkCnt) - :[scratch] "r" (scratch),[eight] "r"(8),[inv_2pow3] "r"(inv_2pow3), - [one] "r" (1) - :"q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"); - -#endif - ptTarget += wLength; - pchTargetMask += wLength; - - wLengthLeft -= wLength; - } while (wLengthLeft); - - ptSource += iSourceStride; - ptTargetBase += iTargetStride; - #if __API_CAFWM_CFG_SUPPORT_SRC_MSK_WRAPING - iSourceMaskY++; - //! handle source mask - if ( (iSourceMaskY >= ptSourceMaskSize->iHeight) - || (iSourceMaskY >= ptSourceSize->iHeight)) { - pchSourceMask = pchSourceMaskBase; - iSourceMaskY = 0; - } else { - pchSourceMask += iSourceMaskStride; - } - #else - pchSourceMask += iSourceMaskStride; - #endif - - pchTargetMaskLineBase = pchTargetMaskBase; - - iTargetY++; - if (iTargetY >= ptTargetSize->iHeight) { - break; - } - } - } -} - -#endif - -#ifdef __cplusplus -} -#endif - -#endif // __ARM_2D_HAS_HELIUM__ diff --git a/package/Arm2D/Library/Source/arm_2d_transform.c b/package/Arm2D/Library/Source/arm_2d_transform.c deleted file mode 100644 index 021708faf..000000000 --- a/package/Arm2D/Library/Source/arm_2d_transform.c +++ /dev/null @@ -1,1847 +0,0 @@ -/* - * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the License); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* ---------------------------------------------------------------------- - * Project: Arm-2D Library - * Title: arm-2d_transform.c - * Description: APIs for tile transform - * - * $Date: 20 May 2022 - * $Revision: V.1.0.3 - * - * Target Processor: Cortex-M cores - * - * -------------------------------------------------------------------- */ - - -/*============================ INCLUDES ======================================*/ -#define __ARM_2D_IMPL__ - -#include "arm_2d.h" -#include "__arm_2d_impl.h" -#include "math.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunknown-warning-option" -# pragma clang diagnostic ignored "-Wreserved-identifier" -# pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" -# pragma clang diagnostic ignored "-Wmissing-variable-declarations" -# pragma clang diagnostic ignored "-Wcast-qual" -# pragma clang diagnostic ignored "-Wcast-align" -# pragma clang diagnostic ignored "-Wextra-semi-stmt" -# pragma clang diagnostic ignored "-Wsign-conversion" -# pragma clang diagnostic ignored "-Wunused-function" -# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" -# pragma clang diagnostic ignored "-Wdouble-promotion" -# pragma clang diagnostic ignored "-Wunused-parameter" -# pragma clang diagnostic ignored "-Wimplicit-float-conversion" -# pragma clang diagnostic ignored "-Wimplicit-int-conversion" -# pragma clang diagnostic ignored "-Wtautological-pointer-compare" -# pragma clang diagnostic ignored "-Wsign-compare" -# pragma clang diagnostic ignored "-Wfloat-conversion" -# pragma clang diagnostic ignored "-Wmissing-prototypes" -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wundef" -# pragma clang diagnostic ignored "-Wdeclaration-after-statement" -#elif defined(__IS_COMPILER_ARM_COMPILER_5__) -# pragma diag_suppress 174,177,188,68,513,144,1296 -#elif defined(__IS_COMPILER_IAR__) -# pragma diag_suppress=Pa093 -#elif defined(__IS_COMPILER_GCC__) -# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" -#endif - -#include - -/*============================ MACROS ========================================*/ -#undef __PI -#define __PI 3.1415926f - -#define __CALIB 0.009f -/* faster ATAN */ -#define FAST_ATAN_F32_1(x, xabs) \ - (x * (PI / 4.0f) + 0.273f * x * (1.0f - xabs)) -#define EPS_ATAN2 1e-5f - - -#define TO_Q16(x) ((int32_t)(x) << 16) - -/*----------------------------------------------------------------------------* - * Code Template * - *----------------------------------------------------------------------------*/ - -#define __API_PIXEL_AVERAGE_RESULT_GRAY8() \ - ( tPixel >> 8) - -#define __API_PIXEL_AVERAGE_RESULT_RGB565() \ - ( tPixel.R >>= 8, \ - tPixel.G >>= 8, \ - tPixel.B >>= 8, \ - __arm_2d_rgb565_pack(&tPixel)) - -#define __API_PIXEL_AVERAGE_RESULT_CCCN888() \ - ( tPixel.R >>= 8, \ - tPixel.G >>= 8, \ - tPixel.B >>= 8, \ - tPixel.A = *((uint8_t *)pTarget + 3), \ - __arm_2d_cccn888_pack(&tPixel)) - - -#define __API_COLOUR gray8 -#define __API_INT_TYPE uint8_t -#define __API_INT_TYPE_BIT_NUM 16 -#define __API_PIXEL_AVERAGE_INIT() uint16_t tPixel = 0; -#define __API_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_OPA_GRAY8 -#define __API_PIXEL_AVERAGE __ARM_2D_PIXEL_AVERAGE_GRAY8 -#define __API_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT_GRAY8 -#include "__arm_2d_transform.inc" - -#define __API_COLOUR rgb565 -#define __API_INT_TYPE uint16_t -#define __API_INT_TYPE_BIT_NUM 16 -#define __API_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_OPA_RGB565 -#define __API_PIXEL_AVERAGE __ARM_2D_PIXEL_AVERAGE_RGB565 -#define __API_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT_RGB565 -#include "__arm_2d_transform.inc" - -#define __API_COLOUR cccn888 -#define __API_INT_TYPE uint32_t -#define __API_INT_TYPE_BIT_NUM 32 -#define __API_PIXEL_BLENDING __ARM_2D_PIXEL_BLENDING_OPA_CCCN888 -#define __API_PIXEL_AVERAGE __ARM_2D_PIXEL_AVERAGE_CCCN888 -#define __API_PIXEL_AVERAGE_RESULT __API_PIXEL_AVERAGE_RESULT_CCCN888 - -#include "__arm_2d_transform.inc" - -/*============================ MACROFIED FUNCTIONS ===========================*/ -/*============================ TYPES =========================================*/ -/*============================ GLOBAL VARIABLES ==============================*/ -/*============================ PROTOTYPES ====================================*/ -/*============================ LOCAL VARIABLES ===============================*/ -/*============================ IMPLEMENTATION ================================*/ - -/*----------------------------------------------------------------------------* - * Utilities * - *----------------------------------------------------------------------------*/ -__arm_2d_point_adj_alpha_t -__arm_2d_point_get_adjacent_alpha_fp(arm_2d_point_float_t *ptPoint) -{ - assert(NULL != ptPoint); - float x = ptPoint->fX - (int32_t)ptPoint->fX; - float y = ptPoint->fY - (int32_t)ptPoint->fY; - - int16_t iXSign = x < 0 ; - int16_t iYSign = y < 0 ; - - __arm_2d_point_adj_alpha_t tResult = { - .tMatrix = { - [0] = { - .tOffset = { - .iX = -iXSign, - .iY = -iYSign, - }, - #if 0 - .chAlpha = (uint8_t)( - ((float)(1-iXSign) - (float)x) //!< x - * ((float)(1-iYSign) - (float)y) //!< y - * 256.0f - ), - #endif - }, - [1] = { - .tOffset = { - .iX = -iXSign + 1, - .iY = -iYSign, - }, - .chAlpha = (uint8_t)( - ((float)iXSign + (float)x) //!< x - * ((float)(1-iYSign) - (float)y) //!< y - * 256.0f - ), - }, - [2] = { - .tOffset = { - .iX = -iXSign, - .iY = -iYSign + 1, - }, - .chAlpha = (uint8_t)( - ((float)(1-iXSign) - (float)x) //!< x - * ((float)iYSign + (float)y) //!< y - * 256.0f - ), - }, - [3] = { - .tOffset = { - .iX = -iXSign + 1, - .iY = -iYSign +1, - }, - .chAlpha = (uint8_t)( - ((float)iXSign + (float)x) //!< x - * ((float)iYSign + (float)y) //!< y - * 256.0f - ), - }, - }, - }; -#if 1 - tResult.tMatrix[0].chAlpha = 256 - - tResult.tMatrix[1].chAlpha - - tResult.tMatrix[2].chAlpha - - tResult.tMatrix[3].chAlpha; -#endif - return tResult; -} - -__arm_2d_point_adj_alpha_t -__arm_2d_point_get_adjacent_alpha_q16(arm_2d_point_fx_t *ptPoint) -{ - assert(NULL != ptPoint); - int32_t x = ptPoint->X & 0xFFFF; - int32_t y = ptPoint->Y & 0xFFFF; - - x |= ((ptPoint->X < 0) * 0xFFFF0000); - y |= ((ptPoint->Y < 0) * 0xFFFF0000); - - int_fast16_t iXSign = x < 0;// ? 1 : 0; - int_fast16_t iYSign = y < 0;// ? 1 : 0; - - __arm_2d_point_adj_alpha_t tResult = { - .tMatrix = { - [0] = { - .tOffset = { - .iX = -iXSign, - .iY = -iYSign, - }, - #if 0 - .chAlpha = (uint8_t)__USAT( - MUL_Q16(MUL_Q16( (TO_Q16(1-iXSign) - x) //!< x - , (TO_Q16(1-iYSign) - y)) //!< y - , TO_Q16(256) - ) >> 16, 8), - #endif - }, - [1] = { - .tOffset = { - .iX = -iXSign + 1, - .iY = -iYSign, - }, - .chAlpha = (uint8_t)__USAT( - MUL_Q16(MUL_Q16( (TO_Q16(iXSign) + x) //!< x - , (TO_Q16(1-iYSign) - y)) //!< y - , TO_Q16(256) - ) >> 16, 8), - }, - [2] = { - .tOffset = { - .iX = -iXSign, - .iY = -iYSign + 1, - }, - .chAlpha = (uint8_t)__USAT( - MUL_Q16(MUL_Q16( (TO_Q16(1-iXSign) - x) //!< x - , (TO_Q16(iYSign) + y)) //!< y - , TO_Q16(256) - ) >> 16, 8), - }, - [3] = { - .tOffset = { - .iX = -iXSign + 1, - .iY = -iYSign +1, - }, - .chAlpha = (uint8_t)__USAT( - MUL_Q16(MUL_Q16( (TO_Q16(iXSign) + x) //!< x - , (TO_Q16(iYSign) + y)) //!< y - , TO_Q16(256) - ) >> 16, 8), - }, - }, - }; -#if 1 - tResult.tMatrix[0].chAlpha = 256 - - tResult.tMatrix[1].chAlpha - - tResult.tMatrix[2].chAlpha - - tResult.tMatrix[3].chAlpha; -#endif - - return tResult; -} - - - -#if __ARM_2D_CFG_FORCED_FIXED_POINT_TRANSFORM__ - -static -void __arm_2d_transform_regression(arm_2d_size_t * __RESTRICT ptCopySize, - arm_2d_location_t * pSrcPoint, - float fAngle, - float fScale, - arm_2d_location_t * tOffset, - arm_2d_location_t * center, - arm_2d_rot_linear_regr_t regrCoefs[]) -{ -#define ONE_BY_2PI_Q31 341782637.0f -//#define TO_Q16(x) ((x) << 16) - - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - q31_t invHeightFx; - - if (1 == iHeight) { - invHeightFx = 0x7fffffff; - } else { - invHeightFx = 0x7fffffff / (iHeight - 1); - } - - int32_t AngleFx = lroundf(fAngle * ONE_BY_2PI_Q31); - int32_t ScaleFx = (int32_t)((float)fScale * (float)TO_Q16(1)); - q31_t cosAngleFx = MULTFX(arm_cos_q31(AngleFx), ScaleFx); - q31_t sinAngleFx = MULTFX(arm_sin_q31(AngleFx), ScaleFx); - arm_2d_point_fx_t tPointCornerFx[2][2]; - arm_2d_point_fx_t centerQ16; - arm_2d_point_fx_t srcPointQ16; - arm_2d_point_fx_t tOffsetQ16; - arm_2d_point_fx_t tmp; - int32_t iXQ16, iYQ16; - - - /* Q16 conversion */ - centerQ16.X = TO_Q16(center->iX); - centerQ16.Y = TO_Q16(center->iY); - - srcPointQ16.X = TO_Q16(pSrcPoint->iX); - srcPointQ16.Y = TO_Q16(pSrcPoint->iY); - - tOffsetQ16.X = TO_Q16(tOffset->iX); - tOffsetQ16.Y = TO_Q16(tOffset->iY); - - - /* (0,0) corner */ - tmp.X = srcPointQ16.X + 0 + tOffsetQ16.X; - tmp.Y = srcPointQ16.Y + 0 + tOffsetQ16.Y; - - iXQ16 = tmp.X - centerQ16.X; - iYQ16 = tmp.Y - centerQ16.Y; - - tPointCornerFx[0][0].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[0][0].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - - /* ((iWidth - 1),0) corner */ - tmp.X = srcPointQ16.X + 0 + tOffsetQ16.X + TO_Q16(iWidth - 1); - iXQ16 = tmp.X - centerQ16.X; - - tPointCornerFx[1][0].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[1][0].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - - /* ((iWidth - 1),(iHeight - 1)) corner */ - tmp.Y = srcPointQ16.Y + tOffsetQ16.Y + TO_Q16(iHeight - 1); - iYQ16 = tmp.Y - centerQ16.Y; - - tPointCornerFx[1][1].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[1][1].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - - /* (0,(iHeight - 1)) corner */ - tmp.X = srcPointQ16.X + 0 + tOffsetQ16.X; - iXQ16 = tmp.X - centerQ16.X; - - tPointCornerFx[0][1].Y = - __QDADD(__QDADD(centerQ16.Y, MUL_Q16(iYQ16, cosAngleFx)), - MUL_Q16(iXQ16, sinAngleFx)); - tPointCornerFx[0][1].X = - __QDSUB(__QDADD(centerQ16.X, MUL_Q16(iXQ16, cosAngleFx)), - MUL_Q16(iYQ16, sinAngleFx)); - - - /* regression */ - int32_t slopeXFx, slopeYFx; - - /* interpolation in Y direction for 1st elements column */ - slopeXFx = MULTFX( (tPointCornerFx[0][1].X - tPointCornerFx[0][0].X), - invHeightFx); - slopeYFx = MULTFX((tPointCornerFx[0][1].Y - tPointCornerFx[0][0].Y), - invHeightFx); - - regrCoefs[0].slopeY = slopeYFx * 2; - regrCoefs[0].slopeX = slopeXFx * 2; - regrCoefs[0].interceptY = tPointCornerFx[0][0].Y; - regrCoefs[0].interceptX = tPointCornerFx[0][0].X; - - - /* interpolation in Y direction for the last elements column */ - slopeXFx = MULTFX( (tPointCornerFx[1][1].X - tPointCornerFx[1][0].X), - invHeightFx); - slopeYFx = MULTFX( (tPointCornerFx[1][1].Y - tPointCornerFx[1][0].Y), - invHeightFx); - - regrCoefs[1].slopeY = slopeYFx* 2; - regrCoefs[1].slopeX = slopeXFx* 2; - regrCoefs[1].interceptY = tPointCornerFx[1][0].Y; - regrCoefs[1].interceptX = tPointCornerFx[1][0].X; -} - -#else - -static -void __arm_2d_transform_regression(arm_2d_size_t * __RESTRICT ptCopySize, - arm_2d_location_t * pSrcPoint, - float fAngle, - float fScale, - arm_2d_location_t * tOffset, - arm_2d_location_t * ptCenter, - arm_2d_rot_linear_regr_t regrCoefs[]) -{ - int_fast16_t iHeight = ptCopySize->iHeight; - int_fast16_t iWidth = ptCopySize->iWidth; - float invHeight; - - if (1 == iHeight ) { - invHeight = __LARGEINVF32; - } else { - invHeight = 1.0f / (float) (iHeight - 1); - } - - float cosAngle = arm_cos_f32(fAngle) * fScale; - float sinAngle = arm_sin_f32(fAngle) * fScale; - arm_2d_location_t tSrcPoint; - arm_2d_point_float_t tPointCorner[2][2]; - int16_t iX, iY; - - tSrcPoint.iX = pSrcPoint->iX + 0 + tOffset->iX; - tSrcPoint.iY = pSrcPoint->iY + 0 + tOffset->iY; - - iX = tSrcPoint.iX - ptCenter->iX; - iY = tSrcPoint.iY - ptCenter->iY; - - tPointCorner[0][0].fY = (iY * cosAngle + iX * sinAngle + ptCenter->iY); - tPointCorner[0][0].fX = (-iY * sinAngle + iX * cosAngle + ptCenter->iX); - - tSrcPoint.iX = pSrcPoint->iX + (iWidth - 1) + tOffset->iX; - iX = tSrcPoint.iX - ptCenter->iX; - - tPointCorner[1][0].fY = (iY * cosAngle + iX * sinAngle + ptCenter->iY); - tPointCorner[1][0].fX = (-iY * sinAngle + iX * cosAngle + ptCenter->iX); - - tSrcPoint.iY = pSrcPoint->iY + (iHeight - 1) + tOffset->iY; - iY = tSrcPoint.iY - ptCenter->iY; - - tPointCorner[1][1].fY = (iY * cosAngle + iX * sinAngle + ptCenter->iY); - tPointCorner[1][1].fX = (-iY * sinAngle + iX * cosAngle + ptCenter->iX); - - tSrcPoint.iX = pSrcPoint->iX + 0 + tOffset->iX; - iX = tSrcPoint.iX - ptCenter->iX; - - tPointCorner[0][1].fY = (iY * cosAngle + iX * sinAngle + ptCenter->iY); - tPointCorner[0][1].fX = (-iY * sinAngle + iX * cosAngle + ptCenter->iX); - - float slopeX, slopeY; - - /* interpolation in Y direction for 1st elements column */ - slopeX = (tPointCorner[0][1].fX - tPointCorner[0][0].fX) * invHeight; - slopeY = (tPointCorner[0][1].fY - tPointCorner[0][0].fY) * invHeight; - - regrCoefs[0].slopeY = slopeY; - regrCoefs[0].slopeX = slopeX; - regrCoefs[0].interceptY = tPointCorner[0][0].fY; - regrCoefs[0].interceptX = tPointCorner[0][0].fX; - - - /* interpolation in Y direction for the last elements column */ - slopeX = (tPointCorner[1][1].fX - tPointCorner[1][0].fX) * invHeight; - slopeY = (tPointCorner[1][1].fY - tPointCorner[1][0].fY) * invHeight; - - regrCoefs[1].slopeY = slopeY; - regrCoefs[1].slopeX = slopeX; - regrCoefs[1].interceptY = tPointCorner[1][0].fY; - regrCoefs[1].interceptX = tPointCorner[1][0].fX; -} - -#endif - - -ARM_NONNULL(1,2,5) -static -arm_2d_point_float_t *__arm_2d_transform_point( - const arm_2d_location_t *ptLocation, - const arm_2d_location_t *ptCenter, - float fAngle, - float fScale, - arm_2d_point_float_t *ptOutBuffer) -{ - int16_t iX = ptLocation->iX - ptCenter->iX; - int16_t iY = ptLocation->iY - ptCenter->iY; - - float fX,fY; - - float cosAngle = arm_cos_f32(fAngle) * fScale; - float sinAngle = arm_sin_f32(fAngle) * fScale; - - fY = (iY * cosAngle + iX * sinAngle + ptCenter->iY); - fX = (-iY * sinAngle + iX * cosAngle + ptCenter->iX); - - -#if !defined(__ARM_2D_CFG_UNSAFE_IGNORE_CALIB_IN_TRANSFORM__) - if (fX > 0) { - ptOutBuffer->fX = fX + __CALIB; - } else { - ptOutBuffer->fX = fX - __CALIB; - } - if (fY > 0) { - ptOutBuffer->fY = fY + __CALIB; - } else { - ptOutBuffer->fY = fY - __CALIB; - } -#else - ptOutBuffer->fX = fX; - ptOutBuffer->fY = fY; -#endif - - return ptOutBuffer; -} - - -static arm_2d_err_t __arm_2d_transform_preprocess_source( - arm_2d_op_trans_t *ptThis, - __arm_2d_transform_info_t *ptTransform) -{ - arm_2d_tile_t *ptSource = (arm_2d_tile_t *)this.Source.ptTile; - - memset(ptSource, 0, sizeof(*ptSource)); - - ptSource->tInfo = this.Origin.ptTile->tInfo; - ptSource->bIsRoot = true; - ptSource->pchBuffer = NULL; //!< special case - - arm_2d_region_t tOrigValidRegion; - if (NULL == arm_2d_tile_get_root(this.Origin.ptTile, &tOrigValidRegion, NULL)) { - return ARM_2D_ERR_OUT_OF_REGION; - } - - //! angle validation - ptTransform->fAngle = fmodf(ptTransform->fAngle, ARM_2D_ANGLE(360)); - if (0.0f == ptTransform->fScale) { - ptTransform->fScale = 1.0f; - } - - //! calculate the source region - do { - arm_2d_point_float_t tPoint; - - arm_2d_location_t tTopLeft = {.iX = INT16_MAX, .iY = INT16_MAX}; - arm_2d_location_t tBottomRight = {.iX = INT16_MIN, .iY = INT16_MIN}; - - //! Top Left - arm_2d_location_t tCornerPoint = tOrigValidRegion.tLocation; - __arm_2d_transform_point( &tCornerPoint, - &ptTransform->tCenter, - ptTransform->fAngle, - ptTransform->fScale, - &tPoint); - - do { - tTopLeft.iX = MIN(tTopLeft.iX, tPoint.fX); - tTopLeft.iY = MIN(tTopLeft.iY, tPoint.fY); - - tBottomRight.iX = MAX(tBottomRight.iX, tPoint.fX); - tBottomRight.iY = MAX(tBottomRight.iY, tPoint.fY); - } while(0); - - //! Bottom Left - tCornerPoint.iY += tOrigValidRegion.tSize.iHeight - 1; - __arm_2d_transform_point( &tCornerPoint, - &ptTransform->tCenter, - ptTransform->fAngle, - ptTransform->fScale, - &tPoint); - - do { - tTopLeft.iX = MIN(tTopLeft.iX, tPoint.fX); - tTopLeft.iY = MIN(tTopLeft.iY, tPoint.fY); - - tBottomRight.iX = MAX(tBottomRight.iX, tPoint.fX); - tBottomRight.iY = MAX(tBottomRight.iY, tPoint.fY); - } while(0); - - //! Top Right - tCornerPoint = tOrigValidRegion.tLocation; - tCornerPoint.iX += tOrigValidRegion.tSize.iWidth - 1; - - __arm_2d_transform_point( &tCornerPoint, - &ptTransform->tCenter, - ptTransform->fAngle, - ptTransform->fScale, - &tPoint); - - do { - tTopLeft.iX = MIN(tTopLeft.iX, tPoint.fX); - tTopLeft.iY = MIN(tTopLeft.iY, tPoint.fY); - - tBottomRight.iX = MAX(tBottomRight.iX, tPoint.fX); - tBottomRight.iY = MAX(tBottomRight.iY, tPoint.fY); - } while(0); - - //! Bottom Right - tCornerPoint.iY += tOrigValidRegion.tSize.iHeight - 1; - __arm_2d_transform_point( &tCornerPoint, - &ptTransform->tCenter, - ptTransform->fAngle, - ptTransform->fScale, - &tPoint); - - do { - tTopLeft.iX = MIN(tTopLeft.iX, tPoint.fX); - tTopLeft.iY = MIN(tTopLeft.iY, tPoint.fY); - - tBottomRight.iX = MAX(tBottomRight.iX, tPoint.fX); - tBottomRight.iY = MAX(tBottomRight.iY, tPoint.fY); - } while(0); - - //! calculate the region - ptTransform->tDummySourceOffset = tTopLeft; - - ptSource->tRegion.tSize.iHeight = tBottomRight.iY - tTopLeft.iY + 1; - ptSource->tRegion.tSize.iWidth = tBottomRight.iX - tTopLeft.iX + 1; - - ptTransform->fScale = 1.0f / ptTransform->fScale; - - //ptTransform->tTargetRegion.tSize = ptSource->tRegion.tSize; - } while(0); - - return ARM_2D_ERR_NONE; -} - - -static void __arm_2d_transform_preprocess_target( - arm_2d_op_trans_t *ptThis, - const arm_2d_location_t *ptTargetCentre) -{ - __arm_2d_transform_info_t *ptTransform - = (__arm_2d_transform_info_t *) - ( (uintptr_t)ptThis - + this.use_as__arm_2d_op_core_t.ptOp->Info.chInClassOffset); - - //! the following code is correct. DO NOT modify it unless you 100% sure. - ptTransform->Target.tRegion.tSize = this.Source.ptTile->tRegion.tSize; - -#if 0 //!< please keep this code for understanding the original meaning - arm_2d_region_t tTargetRegion = {0}; - if (NULL != this.Target.ptRegion) { - tTargetRegion = *this.Target.ptRegion; - } else { - tTargetRegion.tSize = this.Target.ptTile->tRegion.tSize; - } -#else - //! equivalent code - assert(NULL == this.Target.ptRegion); - - arm_2d_region_t tTargetRegion = { - .tSize = this.Target.ptTile->tRegion.tSize, - }; -#endif - - this.Target.ptRegion = &ptTransform->Target.tRegion; - - ptTransform->Target.tRegion.tLocation = tTargetRegion.tLocation; - - //! align with the specified center point - do { - - arm_2d_location_t tOffset = { - .iX = ptTransform->tCenter.iX - ptTransform->tDummySourceOffset.iX, - .iY = ptTransform->tCenter.iY - ptTransform->tDummySourceOffset.iY, - }; - - if (NULL == ptTargetCentre) { - arm_2d_location_t tTargetCenter = { - .iX = tTargetRegion.tSize.iWidth >> 1, - .iY = tTargetRegion.tSize.iHeight >> 1, - }; - - tOffset.iX = tTargetCenter.iX - tOffset.iX; - tOffset.iY = tTargetCenter.iY - tOffset.iY; - } else { - tOffset.iX = ptTargetCentre->iX - tOffset.iX; - tOffset.iY = ptTargetCentre->iY - tOffset.iY; - } - ptTransform->Target.tRegion.tLocation.iX += tOffset.iX; - ptTransform->Target.tRegion.tLocation.iY += tOffset.iY; - - } while(0); -} - -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_gray8_tile_transform_prepare( - arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chFillColour) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_t, ptOP); - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_GRAY8; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - this.tTransform.Mask.hwColour = chFillColour; - - return __arm_2d_transform_preprocess_source(ptThis, &this.tTransform); -} - -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_rgb565_tile_transform_prepare( - arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast16_t hwFillColour) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_t, ptOP); - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_RGB565; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - this.tTransform.Mask.hwColour = hwFillColour; - - return __arm_2d_transform_preprocess_source(ptThis, &this.tTransform); -} - -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_cccn888_tile_transform_prepare( - arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint32_t wFillColour) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_t, ptOP); - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_CCCN888; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - this.tTransform.Mask.wColour = wFillColour; - - return __arm_2d_transform_preprocess_source(ptThis, &this.tTransform); -} - -arm_fsm_rt_t __arm_2d_gray8_sw_transform(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_8BIT == OP_CORE.ptOp->Info.Colour.chScheme); - - __arm_2d_impl_gray8_transform( &(ptTask->Param.tCopyOrig), - &this.tTransform); - - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb565_sw_transform(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - - __arm_2d_impl_rgb565_transform( &(ptTask->Param.tCopyOrig), - &this.tTransform); - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_cccn888_sw_transform(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - - __arm_2d_impl_cccn888_transform(&(ptTask->Param.tCopyOrig), - &this.tTransform); - - return arm_fsm_rt_cpl; -} - -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_gray8_tile_transform_with_opacity_prepare( - arm_2d_op_trans_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chFillColour, - uint_fast8_t chOpacity) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_opa_t, ptOP); - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_OPACITY_GRAY8; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - this.tTransform.Mask.chColour = chFillColour; - this.chOpacity = chOpacity; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - - -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_rgb565_tile_transform_with_opacity_prepare( - arm_2d_op_trans_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast16_t hwFillColour, - uint_fast8_t chOpacity) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_opa_t, ptOP); - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_OPACITY_RGB565; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - this.tTransform.Mask.hwColour = hwFillColour; - this.chOpacity = chOpacity; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -ARM_NONNULL(2) -arm_2d_err_t arm_2dp_cccn888_tile_transform_with_opacity_prepare( - arm_2d_op_trans_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint32_t wFillColour, - uint_fast8_t chOpacity) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_opa_t, ptOP); - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_OPACITY_CCCN888; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - this.tTransform.Mask.wColour = wFillColour; - this.chOpacity = chOpacity; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -arm_fsm_rt_t __arm_2d_gray8_sw_transform_with_alpha(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_opa_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_GRAY8 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chOpacity) { - __arm_2d_impl_gray8_transform( &(ptTask->Param.tCopyOrig), - &this.tTransform); - } else { - __arm_2d_impl_gray8_transform_with_opacity( &(ptTask->Param.tCopyOrig), - &this.tTransform, - this.chOpacity); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_rgb565_sw_transform_with_alpha(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_opa_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - - if (255 == this.chOpacity) { - __arm_2d_impl_rgb565_transform( &(ptTask->Param.tCopyOrig), - &this.tTransform); - } else { - __arm_2d_impl_rgb565_transform_with_opacity( &(ptTask->Param.tCopyOrig), - &this.tTransform, - this.chOpacity); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t __arm_2d_cccn888_sw_transform_with_alpha(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_opa_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - - if (255 == this.chOpacity) { - __arm_2d_impl_cccn888_transform(&(ptTask->Param.tCopyOrig), - &this.tTransform); - } else { - __arm_2d_impl_cccn888_transform_with_opacity( &(ptTask->Param.tCopyOrig), - &this.tTransform, - this.chOpacity); - } - return arm_fsm_rt_cpl; -} - -ARM_NONNULL(2) -arm_fsm_rt_t arm_2dp_tile_transform(arm_2d_op_trans_t *ptOP, - const arm_2d_tile_t *ptTarget, - const arm_2d_region_t *ptRegion, - const arm_2d_location_t *ptTargetCentre) -{ - assert(NULL != ptTarget); - - ARM_2D_IMPL(arm_2d_op_trans_t, ptOP); - arm_2d_location_t tTargetCentre; - - if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) { - return arm_fsm_rt_on_going; - } - - if (NULL != ptRegion) { - __arm_2d_transform_info_t *ptTransform - = (__arm_2d_transform_info_t *) - ( (uintptr_t)ptThis - + this.use_as__arm_2d_op_core_t.ptOp->Info.chInClassOffset); - - - this.Target.ptTile = arm_2d_tile_generate_child( - ptTarget, - ptRegion, - &ptTransform->Target.tTile, - false); - if (NULL == this.Target.ptTile) { - arm_fsm_rt_t tResult = (arm_fsm_rt_t)ARM_2D_ERR_OUT_OF_REGION; - if (ARM_2D_RUNTIME_FEATURE.TREAT_OUT_OF_RANGE_AS_COMPLETE) { - tResult = arm_fsm_rt_cpl; - } - - return __arm_2d_op_depose((arm_2d_op_core_t *)ptThis, tResult); - } - - if (NULL != ptTargetCentre) { - tTargetCentre.iX = ptTargetCentre->iX - ptRegion->tLocation.iX; - tTargetCentre.iY = ptTargetCentre->iY - ptRegion->tLocation.iY; - - ptTargetCentre = &tTargetCentre; - } - } else { - this.Target.ptTile = ptTarget; - //this.Target.ptRegion = ptRegion; - } - - this.Target.ptRegion = NULL; - - __arm_2d_transform_preprocess_target( ptThis, ptTargetCentre); - return __arm_2d_op_invoke((arm_2d_op_core_t *)ptThis); -} - - - -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_gray8_tile_transform_with_src_mask_prepare( - arm_2d_op_trans_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate(ptSource, - ptSourceMask, - NULL, - NULL, - 0); - if (tErr < 0) { - return tErr; - } - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_GRAY8; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - //this.tTransform.Mask.hwColour = chFillColour; - this.Mask.ptOriginSide = ptSourceMask; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_rgb565_tile_transform_with_src_mask_prepare( - arm_2d_op_trans_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate(ptSource, - ptSourceMask, - NULL, - NULL, - 0); - if (tErr < 0) { - return tErr; - } - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_RGB565; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - //this.tTransform.Mask.hwColour = hwFillColour; - this.Mask.ptOriginSide = ptSourceMask; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_cccn888_tile_transform_with_src_mask_prepare( - arm_2d_op_trans_msk_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_msk_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate(ptSource, - ptSourceMask, - NULL, - NULL, - 0); - if (tErr < 0) { - return tErr; - } - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_CCCN888; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - //this.tTransform.Mask.hwColour = wFillColour; - this.Mask.ptOriginSide = ptSourceMask; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -arm_fsm_rt_t -__arm_2d_gray8_sw_transform_with_src_mask(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_msk_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_8BIT == OP_CORE.ptOp->Info.Colour.chScheme); - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - bool bIsMaskChannel8In32 = (ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyOrigMask.tOrigMask.tColour.chScheme); - - if (bIsMaskChannel8In32) { - __arm_2d_impl_gray8_transform_with_src_chn_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } else -#endif - { - __arm_2d_impl_gray8_transform_with_src_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t -__arm_2d_rgb565_sw_transform_with_src_mask(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_msk_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - bool bIsMaskChannel8In32 = (ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyOrigMask.tOrigMask.tColour.chScheme); - - if (bIsMaskChannel8In32) { - __arm_2d_impl_rgb565_transform_with_src_chn_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } else -#endif - { - __arm_2d_impl_rgb565_transform_with_src_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t -__arm_2d_cccn888_sw_transform_with_src_mask(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_msk_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - bool bIsMaskChannel8In32 = (ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyOrigMask.tOrigMask.tColour.chScheme); - - if (bIsMaskChannel8In32) { - __arm_2d_impl_cccn888_transform_with_src_chn_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } else -#endif - { - __arm_2d_impl_cccn888_transform_with_src_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } - - return arm_fsm_rt_cpl; -} - - - -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_gray8_tile_transform_with_src_mask_and_opacity_prepare( - arm_2d_op_trans_msk_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chOpacity) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_msk_opa_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate(ptSource, - ptSourceMask, - NULL, - NULL, - 0); - if (tErr < 0) { - return tErr; - } - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_GRAY8; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - //this.tTransform.Mask.hwColour = chFillColour; - this.Mask.ptOriginSide = ptSourceMask; - this.chOpacity = chOpacity; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare( - arm_2d_op_trans_msk_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chOpacity) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_msk_opa_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate(ptSource, - ptSourceMask, - NULL, - NULL, - 0); - if (tErr < 0) { - return tErr; - } - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_RGB565; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - //this.tTransform.Mask.hwColour = hwFillColour; - this.Mask.ptOriginSide = ptSourceMask; - this.chOpacity = chOpacity; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -ARM_NONNULL(2,3) -arm_2d_err_t arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare( - arm_2d_op_trans_msk_opa_t *ptOP, - const arm_2d_tile_t *ptSource, - const arm_2d_tile_t *ptSourceMask, - const arm_2d_location_t tCentre, - float fAngle, - float fScale, - uint_fast8_t chOpacity) -{ - assert(NULL != ptSource); - - ARM_2D_IMPL(arm_2d_op_trans_msk_opa_t, ptOP); - - arm_2d_err_t tErr = __arm_mask_validate(ptSource, - ptSourceMask, - NULL, - NULL, - 0); - if (tErr < 0) { - return tErr; - } - - if (!arm_2d_op_wait_async((arm_2d_op_core_t *)ptThis)) { - return ARM_2D_ERR_BUSY; - } - - OP_CORE.ptOp = &ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_CCCN888; - - this.Source.ptTile = &this.Origin.tDummySource; - this.Origin.ptTile = ptSource; - this.wMode = 0; - this.tTransform.fAngle = fAngle; - this.tTransform.fScale = fScale; - this.tTransform.tCenter = tCentre; - //this.tTransform.Mask.hwColour = wFillColour; - this.Mask.ptOriginSide = ptSourceMask; - this.chOpacity = chOpacity; - - return __arm_2d_transform_preprocess_source((arm_2d_op_trans_t *)ptThis, - &this.tTransform); -} - -arm_fsm_rt_t -__arm_2d_gray8_sw_transform_with_src_mask_and_opacity(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_msk_opa_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_8BIT == OP_CORE.ptOp->Info.Colour.chScheme); - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - bool bIsMaskChannel8In32 = (ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyOrigMask.tOrigMask.tColour.chScheme); -#endif - - if (255 == this.chOpacity) { - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (bIsMaskChannel8In32) { - __arm_2d_impl_gray8_transform_with_src_chn_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } else - #endif - { - __arm_2d_impl_gray8_transform_with_src_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } - } else { - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (bIsMaskChannel8In32) { - __arm_2d_impl_gray8_transform_with_src_chn_mask_and_opacity( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform, - this.chOpacity); - } else - #endif - { - __arm_2d_impl_gray8_transform_with_src_mask_and_opacity( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform, - this.chOpacity); - } - } - - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t -__arm_2d_rgb565_sw_transform_with_src_mask_and_opacity(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_msk_opa_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_RGB565 == OP_CORE.ptOp->Info.Colour.chScheme); - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - bool bIsMaskChannel8In32 = (ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyOrigMask.tOrigMask.tColour.chScheme); -#endif - - if (255 == this.chOpacity) { - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (bIsMaskChannel8In32) { - __arm_2d_impl_rgb565_transform_with_src_chn_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } else - #endif - { - __arm_2d_impl_rgb565_transform_with_src_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } - } else { - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (bIsMaskChannel8In32) { - __arm_2d_impl_rgb565_transform_with_src_chn_mask_and_opacity( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform, - this.chOpacity); - } else - #endif - { - __arm_2d_impl_rgb565_transform_with_src_mask_and_opacity( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform, - this.chOpacity); - } - } - - return arm_fsm_rt_cpl; -} - -arm_fsm_rt_t -__arm_2d_cccn888_sw_transform_with_src_mask_and_opacity(__arm_2d_sub_task_t *ptTask) -{ - ARM_2D_IMPL(arm_2d_op_trans_msk_opa_t, ptTask->ptOP); - assert(ARM_2D_COLOUR_SZ_32BIT == OP_CORE.ptOp->Info.Colour.u3ColourSZ); - -#if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - bool bIsMaskChannel8In32 = (ARM_2D_CHANNEL_8in32 - == ptTask->Param.tCopyOrigMask.tOrigMask.tColour.chScheme); -#endif - - if (255 == this.chOpacity) { - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (bIsMaskChannel8In32) { - __arm_2d_impl_cccn888_transform_with_src_chn_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } else - #endif - { - __arm_2d_impl_cccn888_transform_with_src_mask( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform); - } - } else { - #if __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ - if (bIsMaskChannel8In32) { - __arm_2d_impl_cccn888_transform_with_src_chn_mask_and_opacity( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform, - this.chOpacity); - } else - #endif - { - __arm_2d_impl_cccn888_transform_with_src_mask_and_opacity( - &(ptTask->Param.tCopyOrigMask), - &this.tTransform, - this.chOpacity); - } - } - return arm_fsm_rt_cpl; -} - - - -/*----------------------------------------------------------------------------* - * Accelerable Low Level APIs * - *----------------------------------------------------------------------------*/ - - -/*----------------------------------------------------------------------------* - * Draw a point whose cordinates is stored as float point. * - *----------------------------------------------------------------------------*/ - -#if 0 -static arm_2d_region_t *__arm_2d_calculate_region( const arm_2d_point_float_t *ptLocation, - arm_2d_region_t *ptRegion) -{ - assert(NULL != ptLocation); - assert(NULL != ptRegion); - - /* +-----+-----+ - * | P0 | P1 | - * +---- p ----+ - * | P2 | -- | - * +-----+-----+ - */ - - arm_2d_location_t tPoints[3]; - - tPoints[0].iX = (int16_t)ptLocation->fX; - tPoints[2].iX = (int16_t)ptLocation->fX; - tPoints[1].iX = (int16_t)(ptLocation->fX + 0.99f); - ptRegion->tSize.iWidth = tPoints[1].iX - tPoints[0].iX + 1; - - tPoints[0].iY = (int16_t)ptLocation->fY; - tPoints[2].iY = (int16_t)ptLocation->fY; - tPoints[1].iY = (int16_t)(ptLocation->fY + 0.99f); - ptRegion->tSize.iHeight = tPoints[2].iY - tPoints[0].iY + 1; - - ptRegion->tLocation = tPoints[0]; - - return ptRegion; -} -#endif - - - -/*----------------------------------------------------------------------------* - * Low Level IO Interfaces * - *----------------------------------------------------------------------------*/ - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_GRAY8, - __arm_2d_gray8_sw_transform); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_RGB565, - __arm_2d_rgb565_sw_transform); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_CCCN888, - __arm_2d_cccn888_sw_transform); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_ALPHA_GRAY8, - __arm_2d_gray8_sw_transform_with_alpha); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_ALPHA_RGB565, - __arm_2d_rgb565_sw_transform_with_alpha); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_ALPHA_CCCN888, - __arm_2d_cccn888_sw_transform_with_alpha); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_GRAY8, - __arm_2d_gray8_sw_transform_with_src_mask); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_RGB565, - __arm_2d_rgb565_sw_transform_with_src_mask); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_CCCN888, - __arm_2d_cccn888_sw_transform_with_src_mask); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_GRAY8, - __arm_2d_gray8_sw_transform_with_src_mask_and_opacity); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_RGB565, - __arm_2d_rgb565_sw_transform_with_src_mask_and_opacity); - -__WEAK -def_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_CCCN888, - __arm_2d_cccn888_sw_transform_with_src_mask_and_opacity); - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM, - .chInClassOffset = offsetof(arm_2d_op_trans_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_GRAY8), - .ptFillOrigLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM, - .chInClassOffset = offsetof(arm_2d_op_trans_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_RGB565), - .ptFillOrigLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM, - .chInClassOffset = offsetof(arm_2d_op_trans_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_CCCN888), - .ptFillOrigLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_OPACITY_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_GRAY8, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_OPACITY, - .chInClassOffset = offsetof(arm_2d_op_trans_opa_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_ALPHA_GRAY8), - .ptFillOrigLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_OPACITY_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_OPACITY, - .chInClassOffset = offsetof(arm_2d_op_trans_opa_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_ALPHA_RGB565), - .ptFillOrigLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_OPACITY_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_OPACITY, - .chInClassOffset = offsetof(arm_2d_op_trans_opa_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_ALPHA_CCCN888), - .ptFillOrigLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - .bHasSrcMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK, - .chInClassOffset = offsetof(arm_2d_op_trans_msk_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_GRAY8), - .ptFillOrigLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - .bHasSrcMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK, - .chInClassOffset = offsetof(arm_2d_op_trans_msk_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_RGB565), - .ptFillOrigLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - .bHasSrcMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK, - .chInClassOffset = offsetof(arm_2d_op_trans_msk_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_CCCN888), - .ptFillOrigLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_GRAY8 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_8BIT, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - .bHasSrcMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK_AND_OPACITY, - .chInClassOffset = offsetof(arm_2d_op_trans_msk_opa_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_GRAY8), - .ptFillOrigLike = NULL, - }, - }, -}; - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_RGB565 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_RGB565, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - .bHasSrcMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK_AND_OPACITY, - .chInClassOffset = offsetof(arm_2d_op_trans_msk_opa_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_RGB565), - .ptFillOrigLike = NULL, - }, - }, -}; - - -const __arm_2d_op_info_t ARM_2D_OP_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_CCCN888 = { - .Info = { - .Colour = { - .chScheme = ARM_2D_COLOUR_CCCN888, - }, - .Param = { - .bHasSource = true, - .bHasOrigin = true, - .bHasTarget = true, - .bHasSrcMask = true, - }, - .chOpIndex = __ARM_2D_OP_IDX_TRANSFORM_WITH_SOURCE_MASK_AND_OPACITY, - .chInClassOffset = offsetof(arm_2d_op_trans_msk_opa_t, tTransform), - - .LowLevelIO = { - .ptCopyOrigLike = ref_low_lv_io(__ARM_2D_IO_TRANSFORM_WITH_SRC_MSK_AND_OPACITY_CCCN888), - .ptFillOrigLike = NULL, - }, - }, -}; - - -#ifdef __cplusplus -} -#endif diff --git a/package/Arm2D/asset_corner_box.c b/package/Arm2D/asset_corner_box.c index 74ca48801..66ff9ba39 100644 --- a/package/Arm2D/asset_corner_box.c +++ b/package/Arm2D/asset_corner_box.c @@ -47,12 +47,10 @@ extern const arm_2d_tile_t c_tileWhiteDotAlphaQuarter; /*============================ PROTOTYPES ====================================*/ -__attribute__((nothrow)) /*============================ LOCAL VARIABLES ===============================*/ -declare_tile(s_tCorner) -implement_tile(s_tCorner, 7, 7, uint8_t, +impl_fb(s_tCorner, 7, 7, uint8_t, .tInfo = { .bIsRoot = true, .bHasEnforcedColour = true, diff --git a/package/Arm2D/asset_small_icon_sun.c b/package/Arm2D/asset_small_icon_sun.c new file mode 100644 index 000000000..f0e638e81 --- /dev/null +++ b/package/Arm2D/asset_small_icon_sun.c @@ -0,0 +1,1182 @@ + +/* Generated on Mon Jul 25 11:03:37 2022 from -i */ +/* Re-sized : False */ +/* Rotated : 0.0 deg */ + + + +#include "arm_2d.h" + +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-warning-option" +# pragma clang diagnostic ignored "-Wreserved-identifier" +# pragma clang diagnostic ignored "-Wmissing-variable-declarations" +# pragma clang diagnostic ignored "-Wcast-qual" +#elif defined(__IS_COMPILER_ARM_COMPILER_5__) +# pragma diag_suppress=1296 +#endif + + +__attribute__((aligned(4), section("arm2d.asset.c_bmpPictureSunAlpha"))) +static const uint8_t c_bmpPictureSunAlpha[56*57] = { +/* -0- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -1- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -2- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -3- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -4- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -5- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -6- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -7- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -8- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -9- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -10- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -11- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -12- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -13- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -14- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -15- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -16- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -17- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -18- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -19- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -20- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -21- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -22- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -23- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -24- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -25- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -26- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -27- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -28- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -29- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -30- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -31- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -32- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -33- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -34- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -35- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -36- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -37- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -38- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -39- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -40- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -41- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -42- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -43- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -44- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -45- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -46- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -47- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -48- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -49- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -50- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -51- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -52- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -53- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -54- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -55- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -56- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +__attribute__((section("arm2d.asset.c_bmpPictureSunGRAY8"))) +const uint8_t c_bmpPictureSunGRAY8[56*57] = { +/* -0- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -1- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -2- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x9c, 0xf8, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -3- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xde, 0x95, 0xd0, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -4- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb6, 0x95, 0xb0, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -5- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x9c, 0x95, 0x95, 0xf2, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -6- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x95, 0x95, 0x95, 0xd0, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -7- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x95, 0x95, 0x95, 0x9c, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -8- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xeb, 0x95, 0x95, 0x95, 0x95, 0x95, 0xf2, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -9- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb6, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0x95, 0x95, 0x95, 0x95, 0x95, 0xc4, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -10- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0x95, 0xa2, 0xd0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa9, 0x95, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -11- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa2, 0x95, 0x95, 0x95, 0xc4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xf2, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -12- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0x95, 0x95, 0x95, 0x95, 0x95, 0xc4, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -13- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xa2, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xca, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -14- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0x95, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xde, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xde, 0xc4, 0xb6, 0xb6, 0xb6, 0xc4, 0xd0, 0xf8, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -15- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xde, 0xff, 0xff, 0xff, 0xe4, 0xa9, 0x9c, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb6, +0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -16- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc4, 0x95, 0x95, 0x9c, 0xde, 0xff, 0xff, 0xf8, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0xa9, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -17- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x95, 0x9c, 0xde, 0xff, 0xff, 0xeb, 0xa2, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x9c, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -18- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc4, 0xde, 0xff, 0xff, 0xeb, 0x9c, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0xe4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -19- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x9c, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x9c, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -20- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -21- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xde, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xde, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -22- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xa9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -23- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0xff, 0xff, 0xf2, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xf2, 0xff, 0xff, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -24- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0xca, 0xa9, 0xb0, 0xff, 0xff, 0xd7, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xd0, 0xff, 0xff, 0xb6, 0xa2, 0xc4, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -25- */ +0xff, 0xff, 0xff, 0xff, 0xf8, 0xd0, 0xa9, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xc4, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb6, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0xb0, 0xd0, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -26- */ +0xff, 0xf8, 0xde, 0xb0, 0x9c, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb6, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb6, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -27- */ +0xde, 0x9c, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xd0, 0xff, 0xff, 0xff, +/* -28- */ +0xff, 0xff, 0xd0, 0xb0, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xd0, 0xf8, 0xff, 0xff, 0xff, 0xff, +/* -29- */ +0xff, 0xff, 0xff, 0xff, 0xf2, 0xd0, 0xa2, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xc4, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xbd, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0xa9, 0xca, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -30- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4, 0xca, 0xa2, 0xb0, 0xff, 0xff, 0xde, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xd0, 0xff, 0xff, 0xb6, 0x9c, 0xca, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -31- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4, 0xff, 0xff, 0xf8, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xf2, 0xff, 0xff, 0xf8, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -32- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xa9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -33- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xde, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -34- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb6, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -35- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x9c, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x95, 0x9c, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -36- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0xeb, 0xff, 0xff, 0xe4, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x95, 0x9c, 0xde, 0xff, 0xff, 0xeb, 0xc4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -37- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x9c, 0x9c, 0xeb, 0xff, 0xff, 0xeb, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0x95, 0x9c, 0xde, 0xff, 0xff, 0xeb, 0x9c, 0x95, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -38- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0x95, 0x95, 0x9c, 0xeb, 0xff, 0xff, 0xf8, 0xb0, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, +0x95, 0xb0, 0xf2, 0xff, 0xff, 0xeb, 0x9c, 0x95, 0x95, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -39- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x9c, 0x95, 0x95, 0x95, 0x9c, 0xeb, 0xff, 0xff, 0xff, 0xde, 0xb0, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0xb0, +0xd0, 0xf8, 0xff, 0xff, 0xeb, 0x9c, 0x95, 0x95, 0x95, 0x9c, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -40- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0x95, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xeb, 0xd0, 0xbd, 0xb0, 0xb0, 0xb6, 0xbd, 0xca, 0xeb, 0xff, +0xff, 0xff, 0xff, 0xeb, 0x9c, 0x95, 0x95, 0x95, 0x95, 0x95, 0xca, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -41- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xa2, 0x95, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xb6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xc4, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -42- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xbd, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xf2, 0xbd, 0x95, 0x95, 0x95, 0x95, 0x95, 0xd0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -43- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xa2, 0x95, 0x95, 0x9c, 0xca, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xeb, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x95, 0x95, 0x95, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -44- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0x95, 0x9c, 0xca, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa2, 0x95, 0x95, 0x95, 0x95, 0x95, 0x9c, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x95, 0x95, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -45- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0xd0, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc4, 0x95, 0x95, 0x95, 0x95, 0x95, 0xc4, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0xa9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -46- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x95, 0x95, 0x95, 0x95, 0x95, 0xe4, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -47- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa2, 0x95, 0x95, 0x95, 0xa9, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -48- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0x95, 0x95, 0x95, 0xca, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -49- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x95, 0x95, 0x95, 0xf2, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -50- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb6, 0x95, 0xa9, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -51- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0x95, 0xca, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -52- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x95, 0xf2, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -53- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xde, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -54- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -55- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* -56- */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +__attribute__((section("arm2d.asset.c_bmpPictureSunRGB565"))) +const uint16_t c_bmpPictureSunRGB565[56*57] = { +/* -0- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -1- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff33, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -2- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe22, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -3- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff55, 0xfe00, 0xff11, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -4- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -5- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe22, 0xfe00, 0xfe00, 0xffbb, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -6- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff11, 0xfe00, 0xfe00, 0xfe00, 0xff11, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -7- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe88, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -8- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff99, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xffbb, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -9- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeaa, 0xff33, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeef, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfeee, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -10- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff33, 0xfe00, 0xfe44, 0xff11, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe66, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -11- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe44, 0xfe00, 0xfe00, 0xfe00, 0xfeee, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffbb, 0xfe88, 0xfe88, 0xfe88, 0xfe88, 0xfe88, 0xfe88, 0xfe88, 0xffbb, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -12- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff33, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfeee, +0xffbb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -13- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe44, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfeef, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -14- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeef, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe22, 0xff55, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xff55, 0xfeee, 0xfeaa, 0xfeaa, 0xfeaa, 0xfeee, 0xff11, 0xffdd, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -15- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe22, +0xff55, 0xffff, 0xffff, 0xffff, 0xff77, 0xfe66, 0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfeaa, +0xff33, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -16- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeee, 0xfe00, 0xfe00, 0xfe22, 0xff55, +0xffff, 0xffff, 0xffdd, 0xfeaa, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe66, 0xffbb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -17- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe00, 0xfe22, 0xff55, 0xffff, +0xffff, 0xff99, 0xfe44, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe22, 0xff99, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -18- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeee, 0xff55, 0xffff, 0xffff, +0xff99, 0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xff77, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -19- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, +0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xffbb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -20- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeaa, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -21- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff55, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xff55, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -22- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeaa, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe66, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -23- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffbb, 0xffff, 0xffff, 0xffbb, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xffbb, 0xffff, 0xffff, 0xff99, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -24- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffbb, 0xfeef, 0xfe66, 0xfe88, 0xffff, 0xffff, 0xff33, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xff11, 0xffff, 0xffff, 0xfeaa, 0xfe44, 0xfeee, 0xffbb, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -25- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xff11, 0xfe66, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xfeee, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfeaa, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xff11, +0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -26- */ +0xffff, 0xffdd, 0xff55, 0xfe88, 0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfeaa, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfeaa, 0xff33, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -27- */ +0xff55, 0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xff11, 0xffff, 0xffff, 0xffff, +/* -28- */ +0xffff, 0xffff, 0xff11, 0xfe88, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe88, 0xff11, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, +/* -29- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffbb, 0xff11, 0xfe44, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xfeee, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfecc, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe00, 0xfe00, 0xfe66, 0xfeef, +0xff99, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -30- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff77, 0xfeef, 0xfe44, 0xfe88, 0xffff, 0xffff, 0xff55, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xff11, 0xffff, 0xffff, 0xfeaa, 0xfe22, 0xfeef, 0xff99, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -31- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff77, 0xffff, 0xffff, 0xffdd, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xffbb, 0xffff, 0xffff, 0xffdd, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -32- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe88, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe66, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -33- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff55, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xff33, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -34- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeaa, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -35- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, +0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xff99, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -36- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff11, 0xff99, 0xffff, 0xffff, +0xff77, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xff55, 0xffff, 0xffff, 0xff99, 0xfeee, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -37- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe22, 0xfe22, 0xff99, 0xffff, +0xffff, 0xff99, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe00, 0xfe22, 0xff55, 0xffff, 0xffff, 0xff99, 0xfe22, 0xfe00, 0xffbb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -38- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeef, 0xfe00, 0xfe00, 0xfe22, 0xff99, +0xffff, 0xffff, 0xffdd, 0xfe88, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe00, 0xfe88, 0xffbb, 0xffff, 0xffff, 0xff99, 0xfe22, 0xfe00, 0xfe00, 0xfecc, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -39- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe22, +0xff99, 0xffff, 0xffff, 0xffff, 0xff55, 0xfe88, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe88, +0xff11, 0xffdd, 0xffff, 0xffff, 0xff99, 0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xffbb, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -40- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeef, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe22, 0xff99, 0xffff, 0xffff, 0xffff, 0xffff, 0xff99, 0xff11, 0xfecc, 0xfe88, 0xfe88, 0xfeaa, 0xfecc, 0xfeef, 0xff99, 0xffff, +0xffff, 0xffff, 0xffff, 0xff99, 0xfe22, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfeef, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -41- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe44, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, +0xfe22, 0xfeaa, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xfeee, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -42- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeef, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xfecc, +0xff99, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffbb, 0xfecc, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xff11, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -43- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe44, 0xfe00, 0xfe00, 0xfe22, 0xfeef, 0xffbb, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfeaa, 0xfeaa, 0xfeaa, 0xfeaa, 0xfeaa, 0xfeaa, 0xfeaa, 0xff99, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff11, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -44- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff33, 0xfe00, 0xfe22, 0xfeef, 0xffdd, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe44, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe22, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff11, 0xfe00, 0xfe00, 0xff33, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -45- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe88, 0xff11, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeee, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfeee, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff11, 0xfe66, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -46- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xfe00, 0xff77, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -47- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe44, 0xfe00, 0xfe00, 0xfe00, 0xfe66, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -48- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff33, 0xfe00, 0xfe00, 0xfe00, 0xfeef, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -49- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe00, 0xfe00, 0xfe00, 0xffbb, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -50- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfeaa, 0xfe00, 0xfe66, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -51- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff33, 0xfe00, 0xfeef, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -52- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffdd, 0xfe00, 0xffbb, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -53- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff55, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -54- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -55- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +/* -56- */ +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, +}; + +__attribute__((section("arm2d.asset.c_bmpPictureSunCCCA8888"))) +const uint32_t c_bmpPictureSunCCCA8888[56*57] = { +/* -0- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -1- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe79f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -2- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc410, 0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -3- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffebaf, 0xffffc000, 0xffffe38f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -4- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -5- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc410, 0xffffc000, 0xffffc000, 0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -6- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe38f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffe38f, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -7- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd040, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -8- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xfffff7df, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -9- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffe79f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdf7f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffdc70, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -10- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe79f, 0xffffc000, 0xffffc820, 0xffffe38f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffcc30, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -11- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffdc70, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff7df, 0xffffd040, 0xffffd040, 0xffffd040, 0xffffd040, 0xffffd040, 0xffffd040, 0xffffd040, 0xfffff7df, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -12- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe79f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffdc70, +0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -13- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffdf7f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -14- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdf7f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc410, 0xffffebaf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffebaf, 0xffffdc70, 0xffffd450, 0xffffd450, 0xffffd450, 0xffffdc70, 0xffffe38f, 0xfffffbef, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -15- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, +0xffffebaf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffefbf, 0xffffcc30, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd450, +0xffffe79f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -16- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdc70, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffebaf, +0xffffffff, 0xffffffff, 0xfffffbef, 0xffffd450, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffcc30, 0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -17- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc000, 0xffffc410, 0xffffebaf, 0xffffffff, +0xffffffff, 0xfffff3cf, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc410, 0xfffff3cf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -18- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdc70, 0xffffebaf, 0xffffffff, 0xffffffff, +0xfffff3cf, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffefbf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -19- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, +0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -20- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd450, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -21- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffebaf, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffebaf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -22- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffcc30, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -23- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff7df, 0xffffffff, 0xffffffff, 0xfffff7df, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xfffff7df, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -24- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff7df, 0xffffdf7f, 0xffffcc30, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffe79f, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffe38f, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc820, 0xffffdc70, 0xfffff7df, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -25- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffe38f, 0xffffcc30, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffdc70, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd450, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffe38f, +0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -26- */ +0xffffffff, 0xfffffbef, 0xffffebaf, 0xffffd040, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd450, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffd450, 0xffffe79f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -27- */ +0xffffebaf, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffe38f, 0xffffffff, 0xffffffff, 0xffffffff, +/* -28- */ +0xffffffff, 0xffffffff, 0xffffe38f, 0xffffd040, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffd040, 0xffffe38f, 0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -29- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff7df, 0xffffe38f, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffdc70, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd860, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffcc30, 0xffffdf7f, +0xfffff3cf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -30- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffefbf, 0xffffdf7f, 0xffffc820, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffebaf, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffe38f, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc410, 0xffffdf7f, 0xfffff3cf, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -31- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffefbf, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xfffff7df, 0xffffffff, 0xffffffff, 0xfffffbef, 0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -32- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd040, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffcc30, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -33- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffebaf, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffe79f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -34- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd450, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -35- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, +0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xfffff3cf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -36- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe38f, 0xfffff3cf, 0xffffffff, 0xffffffff, +0xffffefbf, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffebaf, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffdc70, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -37- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc410, 0xffffc410, 0xfffff3cf, 0xffffffff, +0xffffffff, 0xfffff3cf, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffc000, 0xffffc410, 0xffffebaf, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffc410, 0xffffc000, 0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -38- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdf7f, 0xffffc000, 0xffffc000, 0xffffc410, 0xfffff3cf, +0xffffffff, 0xffffffff, 0xfffffbef, 0xffffd040, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc000, 0xffffd040, 0xfffff7df, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffd860, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -39- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, +0xfffff3cf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffebaf, 0xffffd040, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffd040, +0xffffe38f, 0xfffffbef, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -40- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdf7f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc410, 0xfffff3cf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffe38f, 0xffffd860, 0xffffd040, 0xffffd040, 0xffffd450, 0xffffd860, 0xffffdf7f, 0xfffff3cf, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xfffff3cf, 0xffffc410, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffdf7f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -41- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, +0xffffc410, 0xffffd450, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffdc70, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -42- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdf7f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffd860, +0xfffff3cf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffff7df, 0xffffd860, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffe38f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -43- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffdf7f, 0xfffff7df, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffd450, 0xffffd450, 0xffffd450, 0xffffd450, 0xffffd450, 0xffffd450, 0xffffd450, 0xfffff3cf, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe38f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -44- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe79f, 0xffffc000, 0xffffc410, 0xffffdf7f, 0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc410, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe38f, 0xffffc000, 0xffffc000, 0xffffe79f, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -45- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd040, 0xffffe38f, 0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffdc70, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffdc70, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe38f, 0xffffcc30, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -46- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffefbf, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -47- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffc820, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffcc30, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -48- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe79f, 0xffffc000, 0xffffc000, 0xffffc000, 0xffffdf7f, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -49- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc000, 0xffffc000, 0xffffc000, 0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -50- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffd450, 0xffffc000, 0xffffcc30, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -51- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffe79f, 0xffffc000, 0xffffdf7f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -52- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffbef, 0xffffc000, 0xfffff7df, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -53- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffebaf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -54- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -55- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +/* -56- */ +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +}; + + +extern const arm_2d_tile_t c_tilePictureSunGRAY8; +__attribute__((section("arm2d.tile.c_tilePictureSunGRAY8"))) +const arm_2d_tile_t c_tilePictureSunGRAY8 = { + .tRegion = { + .tSize = { + .iWidth = 56, + .iHeight = 57, + }, + }, + .tInfo = { + .bIsRoot = true, + .bHasEnforcedColour = true, + .tColourInfo = { + .chScheme = ARM_2D_COLOUR_GRAY8, + }, + }, + .pchBuffer = (uint8_t *)c_bmpPictureSunGRAY8, +}; + + + + +extern const arm_2d_tile_t c_tilePictureSunRGB565; +__attribute__((section("arm2d.tile.c_tilePictureSunRGB565"))) +const arm_2d_tile_t c_tilePictureSunRGB565 = { + .tRegion = { + .tSize = { + .iWidth = 56, + .iHeight = 57, + }, + }, + .tInfo = { + .bIsRoot = true, + .bHasEnforcedColour = true, + .tColourInfo = { + .chScheme = ARM_2D_COLOUR_RGB565, + }, + }, + .phwBuffer = (uint16_t*)c_bmpPictureSunRGB565, +}; + + + + +extern const arm_2d_tile_t c_tilePictureSunCCCA8888; + +__attribute__((section("arm2d.tile.c_tilePictureSunCCCA8888"))) +const arm_2d_tile_t c_tilePictureSunCCCA8888 = { + .tRegion = { + .tSize = { + .iWidth = 56, + .iHeight = 57, + }, + }, + .tInfo = { + .bIsRoot = true, + .bHasEnforcedColour = true, + .tColourInfo = { + .chScheme = ARM_2D_COLOUR_BGRA8888, + }, + }, + .pwBuffer = (uint32_t*)c_bmpPictureSunCCCA8888, +}; + + + + + +extern const arm_2d_tile_t c_tilePictureSunMask2; + +__attribute__((section("arm2d.tile.c_tilePictureSunMask2"))) +const arm_2d_tile_t c_tilePictureSunMask2 = { + .tRegion = { + .tSize = { + .iWidth = 56, + .iHeight = 57, + }, + }, + .tInfo = { + .bIsRoot = true, + .bHasEnforcedColour = true, + .tColourInfo = { + .chScheme = ARM_2D_CHANNEL_8in32, + }, + }, + .nAddress = ((intptr_t)c_bmpPictureSunCCCA8888) + 3, +}; + + + + +extern const arm_2d_tile_t c_tilePictureSunMask; + +__attribute__((section("arm2d.tile.c_tilePictureSunMask"))) +const arm_2d_tile_t c_tilePictureSunMask = { + .tRegion = { + .tSize = { + .iWidth = 56, + .iHeight = 57, + }, + }, + .tInfo = { + .bIsRoot = true, + .bHasEnforcedColour = true, + .tColourInfo = { + .chScheme = ARM_2D_COLOUR_8BIT, + }, + }, + .pchBuffer = (uint8_t *)c_bmpPictureSunAlpha, +}; + + + +#if defined(__clang__) +# pragma clang diagnostic pop +#elif defined(__IS_COMPILER_ARM_COMPILER_5__) +# pragma diag_warning=1296 +#endif +