arm-software / arm-2d Goto Github PK
View Code? Open in Web Editor NEW2D Graphic Library optimized for Cortex-M processors
License: Apache License 2.0
2D Graphic Library optimized for Cortex-M processors
License: Apache License 2.0
Filling a rectangular area with a repeat pattern in the same colour is common. Existing Filling-colour-with-mask operations have no such capability. Hence, we need to add APIs for
There is a new cmake build but more information is needed.
An example CMakeLists.txt
could look like this one (not yet tested):
# Because we are adding sub directories that are not subfolder of the project
cmake_policy(SET CMP0079 NEW)
project(arm2d_demo_examples C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# For GCC. Change if you use different compiler.
add_compile_options(
-g
-ffunction-sections
-fdata-sections
-Ofast)
add_link_options(-flto)
add_executable(arm2d_demo main.c ...)
# If you include Arm2D headers from any CPP file you need to at least
# disable those warnings
# (but there will be other warnings)
set_source_files_properties(anycppfile.cpp PROPERTIES COMPILE_FLAGS -Wno-subobject-linkage)
# Add platform sources
# This must be copied from Arm-2D project template folder and customized
target_sources(arm2d_demo PUBLIC platform/arm_2d_disp_adapter_0.c)
#When building on host (for instance Mac) you may want to add this
#target_compile_definitions(arm2d_demo PRIVATE _THREAD_SAFE SDL_DISABLE_ARM_NEON_H)
# Add CMSIS-DSP project
# Set to ON when building on host (Mac for instance). OFF for embedded
option(HOST "" OFF)
add_subdirectory(${CMSISDSP}/Source bin_dsp)
# Add Arm2D project
# Define the options before adding the project
# Set to ON when building on host (Mac for instance). To OFF for embedded.
option(ARM2D_HOST "" OFF)
option(ARM2D_CONTROLS "" ON)
option(ARM2D_HELPER "" ON)
option(ARM2D_LCD_PRINTF "" ON)
option(ARM2D_BENCHMARK_GENERIC "" OFF)
option(ARM2D_BENCHMARK_WATCHPANEL "" OFF)
option(ARM2D_ALPHA_BLENDING "" ON)
option(ARM2D_TRANSFORM "" ON)
add_subdirectory(${ARM2D} arm2d_demo_bin)
# Some Arm2D headers must be copied into platform and customized
# Those headers can be found in the Arm-2D template folder
target_include_directories(ARM2D PUBLIC platform)
# Link libs ARM2D depends on CMSISDSP
# and the app depends on Arm2D
# CMSISDSP -> Arm-2D
target_link_libraries(ARM2D PUBLIC CMSISDSP)
# Arm-2D -> Your app
target_link_libraries(arm2d_demo PUBLIC ARM2D)
# Include SDL if building on host
#target_include_directories(arm2d_demo PUBLIC ${SDL2_INCLUDE_DIR})
#target_link_directories(arm2d_demo PUBLIC ${SDL2_LIBRARY})
# Link SDL
#target_link_libraries(arm2d_demo PUBLIC SDL2main SDL2)
# If SDL used, you'll need support file in the Platform folder.
# It can be found in Arm-2D example folders
The existing filling-colour-with-mask operations do not support mirroring the mask.
by
We
Line masks are useful for saving memory and effectively replacing masks that repeat the same lines of pixel horizontally and vertically.
In the scene template: alarm-clock, the mask
extern const arm_2d_tile_t c_tileECGScanMask
is a typical example that should be replaced by a line mask.
We should add the following APIs:
As requested in lvgl/lvgl#4169, it is better to introduce a new transform variant that only does transform operations without colour-keying.
The current Display Adapter is written for the bare-metal environment. However, users can start a dedicated Thread/Task to run the display adapter task (e.g. disp_adapter0_task
) function, but better RTOS supports can be added, for example:
To achieve this, we have to upgrade the display adapter service and add RTOS support for:
* cmsis-rtos
* cmsis-rtos2
Supports for other RTOS, e.g. FreeRTOS, ThreadX, RT-Thread can be added later.
UPDATE - arm_2d_utils.h
enables non-cmsis build, however there is hardcoded arm_math CMSIS.
ORIGINAL - The template arm_2d_user_arch_port.h
has conditional compiling to enable support on MacOS platforms, but I am getting errors from __arm_2d_math.h:78:10
that does not have conditional compilation for MacOS.
I am using the template arch port code from arm2d/examples/\[template\]\[pc\]\[vscode\]/platform/arm_2d_user_arch_port.h
and I am building under MacOS host (M1/aarch64).
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Source/arm_2d.c:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d.h:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d_types.h:42:
[build] /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/__arm_2d_math.h:78:10: fatal error: 'arm_math.h' file not found
[build] #include "arm_math.h"
[build] ^~~~~~~~~~~~
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Source/arm_2d_draw.c:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d.h:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d_types.h:42:
[build] /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/__arm_2d_math.h:78:10: fatal error: 'arm_math.h' file not found
[build] #include "arm_math.h"
[build] ^~~~~~~~~~~~
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Source/arm_2d_conversion.c:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d.h:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d_types.h:42:
[build] /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/__arm_2d_math.h:78:10: fatal error: 'arm_math.h' file not found
[build] #include "arm_math.h"
[build] ^~~~~~~~~~~~
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Source/arm_2d_async.c:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d.h:35:
[build] In file included from /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/arm_2d_types.h:42:
[build] /Users/dimitomov/projects/arm2d-example/arm2d/Library/Include/__arm_2d_math.h:78:10: fatal error: 'arm_math.h' file not found
[build] #include "arm_math.h"
[build] ^~~~~~~~~~~~
Other core library components have conditional definitions for APPLE & APPLE_CC compiler
Library/Include/arm_2d_utils.h:#if defined(__ARM_ARCH) && __ARM_ARCH && !defined(__APPLE__)
Library/Include/arm_2d_utils.h:# elif (defined(__IS_COMPILER_GCC__) || defined(__IS_COMPILER_LLVM__)) && !defined(__APPLE__)
Library/Include/template/arm_2d_user_arch_port.h:#elif defined ( __APPLE_CC__ )
Include the template arm_2d_user_arch_port.h
comes well prepared for compilation on Apple platforms:
#elif defined ( __APPLE_CC__ )
# include <stdint.h>
# define __ALIGNED(x) __attribute__((aligned(x)))
# define __STATIC_FORCEINLINE static inline __attribute__((always_inline))
# define __STATIC_INLINE static inline
# define __WEAK
#else
Filling-colour-with-gradient-opacity is a valuable tool when creating visual elements; it is commonly used in drawing backgrounds for panels, widgets etc.
The following features should be taken into consideration when adding this set of APIs:
We have a document that describes how to deploy the Arm-2D library, but it currently only contains guidance for using cmsis-pack in MDK. For cmake and makefile users, we should provide some basic information so they can write the necessary script to deploy arm-2d.
We also want help from open-source community to contribute support for cmake and/or makefile. For example, creating a cmake/make file project for project template
You can add a folder like cmake and/or makefile here:
For any PR, please commit to the developing branch. Thanks.
Application engineers from silicon vendors often need to write drivers for proprietary hardware accelerators. System engineers from GUI software providers may wish to use the APIs provided by Arm-2D to accelerate low-level operations. Engineers focused on embedded video processing may try using the Arm-2D APIs to process the frame buffer just captured from the camera. People from the open-source community may find something interesting to contribute. All developers mentioned above are seen as professional users.
We need a document for professional users.
In some resource-constrained systems, the Flash (ROM) and SRAM are limited (e.g. 64K Flash, 12K SRAM), or the memory space left for GUI applications is limited, so such systems cannot afford the cost of a decent GUI stack. Meanwhile, such a low-cost system usually won't have a complex graphical user interface, hence application developers can directly use the arm-2d APIs to draw the panels and scenes.
For those application designers, we need a dedicated Getting Started document.
I would like to point out that an identifier like โ__ARM_2D_H__
โ does not fit to the expected naming convention of the C++ language standard.
Would you like to adjust your selection for unique names?
We need a method (or example control) to copy a given source tile to the target tile adding rounded corner automatically.
It is better to allow users changing the corner mask.
It is better to update the existing draw_round_corner_border
and draw_round_corner_box
to allow people to specify the corner mask.
where am I download Cortex-M4 FVP platform and how to use it?
Adding user files to vscode demo requires handwritten makefiles, which is very troublesome.
We need a simple project management function.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.