Git Product home page Git Product logo

arm-2d's People

Contributors

aladdin-wang avatar aobasyp avatar christophe0606 avatar fabklein avatar flylu avatar gorgonmeducer avatar gzbkey avatar hugueskamba avatar jasonbu avatar jonatanantoni avatar keilchris avatar vovamarch avatar z-tam-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arm-2d's Issues

Add API variants to support filling-colour-with-mask-repeat

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

  • Filling colour with mask repeat
  • Filling colour with mask and opacity repeat

More documentation for building with cmake

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

Add API variants to support filling-colour-with-mask operations for mirroring the mask first

The existing filling-colour-with-mask operations do not support mirroring the mask.

by

  • Adding API varients for filling-colour-with-mask-and-mirroring
  • Adding API varients for filling-colour-with-mask-mirroring-and-opacity

We

  • no longer need an intermedia A8 buffer for mirroring the mask first(hence save SRAM)
  • finish the operation in just one step rather than two (hence improve the overall performance)

Add new APIs for filling colour with horizontal/vertical line mask

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.

image

We should add the following APIs:

  • Fill colour with horizontal line mask (with/without opacity)
  • Fill colour with vertical line mask (with/without opacity)

Add helper service for cmsis-rtos2 support

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:

  • Blocking the display adapter task and yield when the pixel pipeline is
    • busy
    • waiting for resources
    • waiting for async tasks to complete in the backend
    • etc
  • Fully support asynchronous mode
  • Improve system parallelism

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.

Non-cmsis build expects arm_math.h from CMSIS - Building on AARCH64 M1 host fails due to arm_math hardcoded dependency

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

Add a set of APIs for colour filling with gradient opacity

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:

  • Support 2/3/4 points gradient mode
  • Have variants to support mask (on the target side)
  • Have variants to support an extra opacity

The solution to support cmake/makefile users

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:
image

For any PR, please commit to the developing branch. Thanks.

Add a document for Getting Started as a Professional User

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.

Add document for Getting Started as an Application Designer

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.

Add an API for copy-tile-with-rounded-corner

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.